Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto: vim syntax highlighting improvements #4749

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@ endif

syn match rustAssert "\<assert\(\w\)*"
syn keyword rustKeyword as break
syn keyword rustKeyword const copy do drop else export extern fail
syn keyword rustKeyword copy do drop else extern
syn keyword rustKeyword for if impl let log
syn keyword rustKeyword loop match mod move mut once priv pure
syn match rustKeyword "\<pub\>"
syn keyword rustKeyword loop match mod move once priv pub pure
syn keyword rustKeyword ref return static
syn match rustKeyword "\<unsafe\>" " Allows also matching unsafe::foo()
syn keyword rustKeyword use while
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 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

" Reserved words
syn keyword rustKeyword m32 m64 m128 f80 f16 f128
syn keyword rustKeyword m32 m64 m128 f80 f16 f128 be

syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
syn keyword rustType f64 i8 i16 i32 i64 str
syn keyword rustType f64 i8 i16 i32 i64 str Self
syn keyword rustType Option Either

" Types from libc
Expand Down Expand Up @@ -134,6 +133,7 @@ hi def link rustMacro Macro
hi def link rustType Type
hi def link rustTodo Todo
hi def link rustAttribute PreProc
hi def link rustStorage StorageClass

" Other Suggestions:
" hi rustAssert ctermfg=yellow
Expand Down