diff --git a/src/etc/vim/indent/rust.vim b/src/etc/vim/indent/rust.vim index 41b9aba729a..43fd917fc97 100644 --- a/src/etc/vim/indent/rust.vim +++ b/src/etc/vim/indent/rust.vim @@ -5,6 +5,4 @@ if exists("b:did_indent") endif let b:did_indent = 1 -setlocal cindent -setlocal cinkeys-=0# -setlocal cino=j1,J1 +setlocal smartindent diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 93cab8445dd..a1a671c8f6e 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -10,14 +10,13 @@ elseif exists("b:current_syntax") finish endif -syn keyword rustAssert assert -syn match rustAssert "assert\(\w\)*" -syn keyword rustKeyword alt again as break -syn keyword rustKeyword check claim const copy do drop else export extern fail +syn match rustAssert "\" " Allows also matching unsafe::foo() syn keyword rustKeyword use while with " FIXME: Scoped impl's name is also fallen in this category syn keyword rustKeyword mod trait class struct enum type nextgroup=rustIdentifier skipwhite @@ -73,7 +72,9 @@ syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 contains=rustAssert " syn match rustMacro '\w\(\w\)*!' syn match rustMacro '#\w\(\w\)*' -syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo +syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained +syn match rustFormat display "%%" contained +syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat syn region rustAttribute start="#\[" end="\]" contains=rustString @@ -108,6 +109,7 @@ hi def link rustHexNumber rustNumber hi def link rustBinNumber rustNumber hi def link rustIdentifierPrime rustIdentifier +hi def link rustFormat Special hi def link rustString String hi def link rustCharacter Character hi def link rustNumber Number