From 37d7c9d1c3696ef4d6eb6680e3b682dcd033beaf Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 1 Aug 2012 13:05:20 -0700 Subject: [PATCH] vim: Move conceal code into vim/after/syntax. This makes concealment opt-in. --- src/etc/vim/after/syntax/rust.vim | 26 ++++++++++++++++++++++++++ src/etc/vim/syntax/rust.vim | 15 +-------------- 2 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 src/etc/vim/after/syntax/rust.vim diff --git a/src/etc/vim/after/syntax/rust.vim b/src/etc/vim/after/syntax/rust.vim new file mode 100644 index 00000000000..5fe51d38f4a --- /dev/null +++ b/src/etc/vim/after/syntax/rust.vim @@ -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 diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 247f38b7a8c..145683ef35f 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -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