From 0224eb3d3273519ed82404b711f8cb0bbab05c95 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 30 Mar 2013 17:19:39 -0400 Subject: [PATCH 1/5] vim: assert and pure keywords were removed --- src/etc/vim/syntax/rust.vim | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index f811fbf585542..a5697a91505be 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -10,11 +10,10 @@ elseif exists("b:current_syntax") finish endif -syn match rustAssert "\(); +syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1 +syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::(); syn match rustMacro '\w\(\w\)*!' syn match rustMacro '#\w\(\w\)*' @@ -126,7 +125,6 @@ hi def link rustBoolean Boolean hi def link rustConstant Constant hi def link rustSelf Constant hi def link rustFloat Float -hi def link rustAssert Keyword hi def link rustKeyword Keyword hi def link rustIdentifier Identifier hi def link rustModPath Include @@ -140,7 +138,6 @@ hi def link rustStorage StorageClass hi def link rustLifetime Special " Other Suggestions: -" hi rustAssert ctermfg=yellow " hi rustMacro ctermfg=magenta syn sync minlines=200 From 7142cdef1e083c628d787abe5b5eaabe52491197 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 30 Mar 2013 17:27:12 -0400 Subject: [PATCH 2/5] vim: highlight ref + static as storage specifiers lifetimes and globals are now the only two places static is used, and 'static isn't matched by this --- src/etc/vim/syntax/rust.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index a5697a91505be..9de051d7fa4ec 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -14,12 +14,12 @@ syn keyword rustKeyword as break syn keyword rustKeyword copy do drop else extern syn keyword rustKeyword for if impl let log syn keyword rustKeyword loop match mod once priv pub -syn keyword rustKeyword ref return static +syn keyword rustKeyword return syn keyword rustKeyword unsafe use while " FIXME: Scoped impl's name is also fallen in this category syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite -syn keyword rustStorage const mut +syn keyword rustStorage const mut ref static syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained From b0f66c4732e28f2409e8f2fe3afa1e564cde7b30 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 30 Mar 2013 17:31:54 -0400 Subject: [PATCH 3/5] vim: mark Todo as contained and rm unsafe from it It's nice to make unsafe stand out, but this way isn't correct because it highlights it in comments. --- src/etc/vim/syntax/rust.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 9de051d7fa4ec..04f5d1f1234b3 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -109,8 +109,7 @@ syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8 syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend - -syn keyword rustTodo TODO FIXME XXX NB unsafe +syn keyword rustTodo contained TODO FIXME XXX NB hi def link rustHexNumber rustNumber hi def link rustBinNumber rustNumber From 6442b1c0e7812cc4a7651dca9ac8df2a70326c79 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 30 Mar 2013 17:39:33 -0400 Subject: [PATCH 4/5] vim: separate the conditional keywords --- src/etc/vim/syntax/rust.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 04f5d1f1234b3..52e8fa69e72ba 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -10,10 +10,13 @@ elseif exists("b:current_syntax") finish endif +syn keyword rustConditional match if else + syn keyword rustKeyword as break -syn keyword rustKeyword copy do drop else extern syn keyword rustKeyword for if impl let log -syn keyword rustKeyword loop match mod once priv pub +syn keyword rustKeyword copy do drop extern +syn keyword rustKeyword for impl let log +syn keyword rustKeyword loop mod once priv pub syn keyword rustKeyword return syn keyword rustKeyword unsafe use while " FIXME: Scoped impl's name is also fallen in this category @@ -125,6 +128,7 @@ hi def link rustConstant Constant hi def link rustSelf Constant hi def link rustFloat Float hi def link rustKeyword Keyword +hi def link rustConditional Conditional hi def link rustIdentifier Identifier hi def link rustModPath Include hi def link rustFuncName Function From 47011e3b710e9ef43a753defc467fefe5dcfd9f3 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 30 Mar 2013 17:51:19 -0400 Subject: [PATCH 5/5] vim: use Operator group for 'as' --- src/etc/vim/syntax/rust.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 52e8fa69e72ba..87f4059716b35 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -11,8 +11,9 @@ elseif exists("b:current_syntax") endif syn keyword rustConditional match if else +syn keyword rustOperator as -syn keyword rustKeyword as break +syn keyword rustKeyword break copy do drop extern syn keyword rustKeyword for if impl let log syn keyword rustKeyword copy do drop extern syn keyword rustKeyword for impl let log @@ -127,6 +128,7 @@ hi def link rustBoolean Boolean hi def link rustConstant Constant hi def link rustSelf Constant hi def link rustFloat Float +hi def link rustOperator Operator hi def link rustKeyword Keyword hi def link rustConditional Conditional hi def link rustIdentifier Identifier