Skip to content

Commit f39c883

Browse files
committed
Vim keyword highlighting improvements.
- Removed the `log` keyword; - Removed keyword duplicates; - Highlighted `const` as `Error` rather than `StorageClass`; and - Highlighted all the reserved keywords as `Error` rather than as `Keyword`. (As usual, these highlightings can be overridden if desired.)
1 parent 3a4d7ff commit f39c883

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/etc/vim/syntax/rust.vim

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ syn keyword rustOperator as
1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
2121
syn keyword rustKeyword break continue do extern
22-
syn keyword rustKeyword in if impl let log
23-
syn keyword rustKeyword for impl let log
24-
syn keyword rustKeyword loop mod once priv pub
22+
syn keyword rustKeyword for in if impl let
23+
syn keyword rustKeyword loop once priv pub
2524
syn keyword rustKeyword return
2625
syn keyword rustKeyword unsafe while
2726
syn keyword rustKeyword use nextgroup=rustModPath skipwhite
2827
" FIXME: Scoped impl's name is also fallen in this category
2928
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
3029
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
3130
syn keyword rustKeyword proc
32-
syn keyword rustStorage const mut ref static
31+
syn keyword rustStorage mut ref static
32+
syn keyword rustObsoleteStorage const
3333

3434
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3535
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3636

3737
" Reserved (but not yet used) keywords {{{2
38-
syn keyword rustKeyword alignof be offsetof pure sizeof typeof yield
38+
syn keyword rustReservedKeyword alignof be offsetof pure sizeof typeof yield
3939

4040
" Built-in types {{{2
4141
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
@@ -228,6 +228,7 @@ hi def link rustSelf Constant
228228
hi def link rustFloat Float
229229
hi def link rustOperator Operator
230230
hi def link rustKeyword Keyword
231+
hi def link rustReservedKeyword Error
231232
hi def link rustConditional Conditional
232233
hi def link rustIdentifier Identifier
233234
hi def link rustCapsIdent rustIdentifier
@@ -248,6 +249,7 @@ hi def link rustTodo Todo
248249
hi def link rustAttribute PreProc
249250
hi def link rustDeriving PreProc
250251
hi def link rustStorage StorageClass
252+
hi def link rustObsoleteStorage Error
251253
hi def link rustLifetime Special
252254

253255
" Other Suggestions:

0 commit comments

Comments
 (0)