Skip to content

Commit 571d866

Browse files
committed
Update vim mode for asserts and #[attributes]
1 parent 54713af commit 571d866

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/etc/vim/syntax/rust.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ if !exists("main_syntax")
1414
let main_syntax='rust'
1515
endif
1616

17-
syn keyword rustKeyword alt as assert break
17+
syn keyword rustAssert assert
18+
syn keyword rustKeyword alt as break
1819
syn keyword rustKeyword check claim cont const copy else export extern fail
1920
syn keyword rustKeyword for if impl import in let log
2021
syn keyword rustKeyword loop mod mut of pure
@@ -39,6 +40,8 @@ syn match rustItemPath "\(\w\|::\)\+"
3940

4041
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+
4142

43+
syn region rustAttribute start="#\[" end="\]" contains=rustString
44+
4245
" Number literals
4346
syn match rustNumber display "\<[0-9][0-9_]*\>"
4447
syn match rustNumber display "\<[0-9][0-9_]*\(u\|u8\|u16\|u32\|u64\)\>"
@@ -69,18 +72,21 @@ syn keyword rustTodo TODO FIXME XXX NB
6972
hi def link rustHexNumber rustNumber
7073
hi def link rustBinNumber rustNumber
7174

75+
" Recommend changing rustAssert to something else - I use ctermfg=yellow.
7276
hi def link rustString String
7377
hi def link rustCharacter Character
7478
hi def link rustNumber Number
7579
hi def link rustBoolean Boolean
7680
hi def link rustFloat Float
81+
hi def link rustAssert Keyword
7782
hi def link rustKeyword Keyword
7883
hi def link rustIdentifier Identifier
7984
hi def link rustFuncName Function
8085
hi def link rustComment Comment
8186
hi def link rustMacro Macro
8287
hi def link rustType Type
8388
hi def link rustTodo Todo
89+
hi def link rustAttribute PreProc
8490

8591
syn sync minlines=200
8692
syn sync maxlines=500

0 commit comments

Comments
 (0)