vim: Move conceal code into vim/after/syntax.
This makes concealment opt-in.
This commit is contained in:
parent
357920a0e7
commit
37d7c9d1c3
26
src/etc/vim/after/syntax/rust.vim
Normal file
26
src/etc/vim/after/syntax/rust.vim
Normal file
@ -0,0 +1,26 @@
|
||||
if exists('g:no_rust_conceal') || !has('conceal') || &enc != 'utf-8'
|
||||
finish
|
||||
endif
|
||||
|
||||
" For those who don't want to see `::`...
|
||||
if exists('g:rust_conceal_mod_path')
|
||||
syn match rustNiceOperator "::" conceal cchar=ㆍ
|
||||
endif
|
||||
|
||||
syn match rustLeftArrowHead contained "-" conceal cchar=
|
||||
syn match rustLeftArrowTail contained "<" conceal cchar=⟵
|
||||
syn match rustNiceOperator "<-" contains=rustLeftArrowHead,rustLeftArrowTail
|
||||
|
||||
syn match rustRightArrowHead contained ">" conceal cchar=
|
||||
syn match rustRightArrowTail contained "-" conceal cchar=⟶
|
||||
syn match rustNiceOperator "->" contains=rustRightArrowHead,rustRightArrowTail
|
||||
|
||||
syn match rustFatRightArrowHead contained ">" conceal cchar=
|
||||
syn match rustFatRightArrowTail contained "=" conceal cchar=⟹
|
||||
syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrowTail
|
||||
|
||||
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=′
|
||||
|
||||
hi link rustNiceOperator Operator
|
||||
hi! link Conceal Operator
|
||||
setlocal conceallevel=2
|
@ -103,19 +103,6 @@ syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo ke
|
||||
|
||||
syn keyword rustTodo TODO FIXME XXX NB
|
||||
|
||||
" For those who don't want to see `::`...
|
||||
syn match rustModPathSep "::" conceal cchar=ㆍ
|
||||
|
||||
syn match rustArrowHead contained ">" conceal cchar=
|
||||
syn match rustArrowTail contained "-" conceal cchar=⟶
|
||||
syn match rustArrowFull "->" contains=rustArrowHead,rustArrowTail
|
||||
|
||||
syn match rustFatArrowHead contained ">" conceal cchar=
|
||||
syn match rustFatArrowTail contained "=" conceal cchar=⟹
|
||||
syn match rustFatArrowFull "=>" contains=rustFatArrowHead,rustFatArrowTail
|
||||
|
||||
syn match rustIdentifierPrime /\<\@!_\(_*\>\)\@=/ conceal cchar=′
|
||||
|
||||
hi def link rustHexNumber rustNumber
|
||||
hi def link rustBinNumber rustNumber
|
||||
hi def link rustIdentifierPrime rustIdentifier
|
||||
@ -136,7 +123,7 @@ hi def link rustMacro Macro
|
||||
hi def link rustType Type
|
||||
hi def link rustTodo Todo
|
||||
hi def link rustAttribute PreProc
|
||||
hi def link rustModPathSep Conceal
|
||||
|
||||
" Other Suggestions:
|
||||
" hi rustAssert ctermfg=yellow
|
||||
" hi rustMacro ctermfg=magenta
|
||||
|
Loading…
x
Reference in New Issue
Block a user