codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Rust3" Maintainer: Patrick Walton <pcwalton@mozilla.com>4" Maintainer: Ben Blum <bblum@cs.cmu.edu>5" Maintainer: Chris Morgan <me@chrismorgan.info>6" Last Change: 2023-09-117" For bugs, patches and license go to https://github.com/rust-lang/rust.vim8 9if version < 60010 syntax clear11elseif exists("b:current_syntax")12 finish13endif14 15" Syntax definitions {{{116" Basic keywords {{{217syn keyword rustConditional match if else18syn keyword rustRepeat loop while19" `:syn match` must be used to prioritize highlighting `for` keyword.20syn match rustRepeat /\<for\>/21" Highlight `for` keyword in `impl ... for ... {}` statement. This line must22" be put after previous `syn match` line to overwrite it.23syn match rustKeyword /\%(\<impl\>.\+\)\@<=\<for\>/24syn keyword rustRepeat in25syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty26syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty27syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained28syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion29syn keyword rustOperator as30syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained31syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef32 33syn match rustAssert "\<assert\(\w\)*!" contained34syn match rustPanic "\<panic\(\w\)*!" contained35syn match rustAsync "\<async\%(\s\|\n\)\@="36syn keyword rustKeyword break37syn keyword rustKeyword box38syn keyword rustKeyword continue39syn keyword rustKeyword crate40syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty41syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty42syn keyword rustKeyword impl let43syn keyword rustKeyword macro44syn keyword rustKeyword pub nextgroup=rustPubScope skipwhite skipempty45syn keyword rustKeyword return46syn keyword rustKeyword yield47syn keyword rustSuper super48syn keyword rustKeyword where49syn keyword rustUnsafeKeyword unsafe50syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty51" FIXME: Scoped impl's name is also fallen in this category52syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipempty53syn keyword rustStorage move mut ref static const54syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/55syn keyword rustAwait await56syn match rustKeyword /\<try\>!\@!/ display57 58syn keyword rustPubScopeCrate crate contained59syn match rustPubScopeDelim /[()]/ contained60syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent61 62syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty63" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.64syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator65syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty66 67syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained68syn match rustFuncName "\%(r#\)\=\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained69 70syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP71syn match rustMacroVariable "$\w\+"72syn match rustRawIdent "\<r#\h\w*" contains=NONE73 74" Reserved (but not yet used) keywords {{{275syn keyword rustReservedKeyword become do priv typeof unsized abstract virtual final override76 77" Built-in types {{{278syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f3279syn keyword rustType f64 i8 i16 i32 i64 i128 str Self80 81" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{282" This section is just straight transformation of the contents of the prelude,83" to make it easy to update.84 85" Reexported core operators {{{386syn keyword rustTrait Copy Send Sized Sync87syn keyword rustTrait Drop Fn FnMut FnOnce88 89" Reexported functions {{{390" There’s no point in highlighting these; when one writes drop( or drop::< it91" gets the same highlighting anyway, and if someone writes `let drop = …;` we92" don’t really want *that* drop to be highlighted.93"syn keyword rustFunction drop94 95" Reexported types and traits {{{396syn keyword rustTrait Box97syn keyword rustTrait ToOwned98syn keyword rustTrait Clone99syn keyword rustTrait PartialEq PartialOrd Eq Ord100syn keyword rustTrait AsRef AsMut Into From101syn keyword rustTrait Default102syn keyword rustTrait Iterator Extend IntoIterator103syn keyword rustTrait DoubleEndedIterator ExactSizeIterator104syn keyword rustEnum Option105syn keyword rustEnumVariant Some None106syn keyword rustEnum Result107syn keyword rustEnumVariant Ok Err108syn keyword rustTrait SliceConcatExt109syn keyword rustTrait String ToString110syn keyword rustTrait Vec111 112" Other syntax {{{2113syn keyword rustSelf self114syn keyword rustBoolean true false115 116" If foo::bar changes to foo.bar, change this ("::" to "\.").117" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").118syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3119syn match rustModPathSep "::"120 121syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1122syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();123 124" This is merely a convention; note also the use of [A-Z], restricting it to125" latin identifiers rather than the full Unicode uppercase. I have not used126" [:upper:] as it depends upon 'noignorecase'127"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"128 129syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"130" This one isn't *quite* right, as we could have binary-& with a reference131syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1132syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1133" This isn't actually correct; a closure with no arguments can be `|| { }`.134" Last, because the & in && isn't a sigil135syn match rustOperator display "&&\|||"136" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,137" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.138syn match rustArrowCharacter display "->"139syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"140 141syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic142syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic143 144syn match rustEscapeError display contained /\\./145syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/146syn match rustEscapeUnicode display contained /\\u{\%(\x_*\)\{1,6}}/147syn match rustStringContinuation display contained /\\\n\s*/148syn region rustString matchgroup=rustStringDelimiter start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation149syn region rustString matchgroup=rustStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell150syn region rustString matchgroup=rustStringDelimiter start='b\?r\z(#*\)"' end='"\z1' contains=@Spell151 152" Match attributes with either arbitrary syntax or special highlighting for153" derives. We still highlight strings and comments inside of the attribute.154syn region rustAttribute start="#!\?\[" end="\]" contains=@rustAttributeContents,rustAttributeParenthesizedParens,rustAttributeParenthesizedCurly,rustAttributeParenthesizedBrackets,rustDerive155syn region rustAttributeParenthesizedParens matchgroup=rustAttribute start="\w\%(\w\)*("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents156syn region rustAttributeParenthesizedCurly matchgroup=rustAttribute start="\w\%(\w\)*{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents157syn region rustAttributeParenthesizedBrackets matchgroup=rustAttribute start="\w\%(\w\)*\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents158syn region rustAttributeBalancedParens matchgroup=rustAttribute start="("rs=e end=")"re=s transparent contained contains=rustAttributeBalancedParens,@rustAttributeContents159syn region rustAttributeBalancedCurly matchgroup=rustAttribute start="{"rs=e end="}"re=s transparent contained contains=rustAttributeBalancedCurly,@rustAttributeContents160syn region rustAttributeBalancedBrackets matchgroup=rustAttribute start="\["rs=e end="\]"re=s transparent contained contains=rustAttributeBalancedBrackets,@rustAttributeContents161syn cluster rustAttributeContents contains=rustString,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError162syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait163" This list comes from src/libsyntax/ext/deriving/mod.rs164" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).165syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy166 167" dyn keyword: It's only a keyword when used inside a type expression, so168" we make effort here to highlight it only when Rust identifiers follow it169" (not minding the case of pre-2018 Rust where a path starting with :: can170" follow).171"172" This is so that uses of dyn variable names such as in 'let &dyn = &2'173" and 'let dyn = 2' will not get highlighted as a keyword.174syn match rustKeyword "\<dyn\ze\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)" contains=rustDynKeyword175syn keyword rustDynKeyword dyn contained176 177" Number literals178syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="179syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="180syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="181syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="182 183" Special case for numbers of the form "1." which are float literals, unless followed by184" an identifier, which makes them integer literals with a method call or field access,185" or by another ".", which makes them integer literals followed by the ".." token.186" (This must go first so the others take precedence.)187syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"188" To mark a number as a normal float, it must have at least one of the three things integral values don't have:189" a decimal point and more numbers; an exponent; and a type suffix.190syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="191syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="192syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"193 194" For the benefit of delimitMate195syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime196syn region rustGenericRegion display start=/<\%('\|[^[:cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate197syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime198 199"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting200syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"201syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:"202syn match rustLabel display "\%(\<\%(break\|continue\)\s*\)\@<=\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"203syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/204" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).205syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/206syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode207syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid208 209syn match rustShebang /\%^#![^[].*/210syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell211syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell212syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained213syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell214syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,rustCommentBlockDocRustCode,@Spell215syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained216syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent217syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent218syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent219 220" FIXME: this is a really ugly and not fully correct implementation. Most221" importantly, a case like ``/* */*`` should have the final ``*`` not being in222" a comment, but in practice at present it leaves comments open two levels223" deep. But as long as you stay away from that particular case, I *believe*224" the highlighting is correct. Due to the way Vim's syntax engine works225" (greedy for start matches, unlike Rust's tokeniser which is searching for226" the earliest-starting match, start or end), I believe this cannot be solved.227" Oh you who would fix it, don't bother with things like duplicating the Block228" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as229" then you must deal with cases like ``/*/**/*/``. And don't try making it230" worse with ``\%(/\@<!\*\)\@<!``, either...231 232syn keyword rustTodo contained TODO FIXME XXX NB NOTE SAFETY233 234" asm! macro {{{2235syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*236 237" Clobbered registers238syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty239syn region rustAsmReg start="(" end=")" contained contains=rustString240 241" Symbol operands242syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty243syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier244 245" Const246syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr247syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens248syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr249 250" Options251syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey252syn keyword rustAsmOptionsKey options contained253syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained254 255" Folding rules {{{2256" Trivial folding rules to begin with.257" FIXME: use the AST to make really good folding258syn region rustFoldBraces start="{" end="}" transparent fold259 260if !exists("b:current_syntax_embed")261 let b:current_syntax_embed = 1262 syntax include @RustCodeInComment <sfile>:p:h/rust.vim263 unlet b:current_syntax_embed264 265 " Currently regions marked as ```<some-other-syntax> will not get266 " highlighted at all. In the future, we can do as vim-markdown does and267 " highlight with the other syntax. But for now, let's make sure we find268 " the closing block marker, because the rules below won't catch it.269 syn region rustCommentLinesDocNonRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\).\+$' end='^\z1$' keepend contains=rustCommentLineDoc270 271 " We borrow the rules from rust’s src/librustdoc/html/markdown.rs, so that272 " we only highlight as Rust what it would perceive as Rust (almost; it’s273 " possible to trick it if you try hard, and indented code blocks aren’t274 " supported because Markdown is a menace to parse and only mad dogs and275 " Englishmen would try to handle that case correctly in this syntax file).276 syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader277 syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar278 " Strictly, this may or may not be correct; this code, for example, would279 " mishighlight:280 "281 " /**282 " ```rust283 " println!("{}", 1284 " * 1);285 " ```286 " */287 "288 " … but I don’t care. Balance of probability, and all that.289 syn match rustCommentBlockDocStar /^\s*\*\s\?/ contained290 syn match rustCommentLineDocLeader "^\s*//\%(//\@!\|!\)" contained291endif292 293" Default highlighting {{{1294hi def link rustDecNumber rustNumber295hi def link rustHexNumber rustNumber296hi def link rustOctNumber rustNumber297hi def link rustBinNumber rustNumber298hi def link rustIdentifierPrime rustIdentifier299hi def link rustTrait rustType300hi def link rustDeriveTrait rustTrait301 302hi def link rustMacroRepeatDelimiters Macro303hi def link rustMacroVariable Define304hi def link rustSigil StorageClass305hi def link rustEscape Special306hi def link rustEscapeUnicode rustEscape307hi def link rustEscapeError Error308hi def link rustStringContinuation Special309hi def link rustString String310hi def link rustStringDelimiter String311hi def link rustCharacterInvalid Error312hi def link rustCharacterInvalidUnicode rustCharacterInvalid313hi def link rustCharacter Character314hi def link rustNumber Number315hi def link rustBoolean Boolean316hi def link rustEnum rustType317hi def link rustEnumVariant rustConstant318hi def link rustConstant Constant319hi def link rustSelf Constant320hi def link rustFloat Float321hi def link rustArrowCharacter rustOperator322hi def link rustOperator Operator323hi def link rustKeyword Keyword324hi def link rustDynKeyword rustKeyword325hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust326hi def link rustStructure Keyword " More precise is Structure327hi def link rustUnion rustStructure328hi def link rustExistential rustKeyword329hi def link rustPubScopeDelim Delimiter330hi def link rustPubScopeCrate rustKeyword331hi def link rustSuper rustKeyword332hi def link rustUnsafeKeyword Exception333hi def link rustReservedKeyword Error334hi def link rustRepeat Conditional335hi def link rustConditional Conditional336hi def link rustIdentifier Identifier337hi def link rustCapsIdent rustIdentifier338hi def link rustModPath Include339hi def link rustModPathSep Delimiter340hi def link rustFunction Function341hi def link rustFuncName Function342hi def link rustFuncCall Function343hi def link rustShebang Comment344hi def link rustCommentLine Comment345hi def link rustCommentLineDoc SpecialComment346hi def link rustCommentLineDocLeader rustCommentLineDoc347hi def link rustCommentLineDocError Error348hi def link rustCommentBlock rustCommentLine349hi def link rustCommentBlockDoc rustCommentLineDoc350hi def link rustCommentBlockDocStar rustCommentBlockDoc351hi def link rustCommentBlockDocError Error352hi def link rustCommentDocCodeFence rustCommentLineDoc353hi def link rustAssert PreCondit354hi def link rustPanic PreCondit355hi def link rustMacro Macro356hi def link rustType Type357hi def link rustTodo Todo358hi def link rustAttribute PreProc359hi def link rustDerive PreProc360hi def link rustDefault StorageClass361hi def link rustStorage StorageClass362hi def link rustObsoleteStorage Error363hi def link rustLifetime Special364hi def link rustLabel Label365hi def link rustExternCrate rustKeyword366hi def link rustObsoleteExternMod Error367hi def link rustQuestionMark Special368hi def link rustAsync rustKeyword369hi def link rustAwait rustKeyword370hi def link rustAsmDirSpec rustKeyword371hi def link rustAsmSym rustKeyword372hi def link rustAsmOptions rustKeyword373hi def link rustAsmOptionsKey rustAttribute374 375" Other Suggestions:376" hi rustAttribute ctermfg=cyan377" hi rustDerive ctermfg=cyan378" hi rustAssert ctermfg=yellow379" hi rustPanic ctermfg=red380" hi rustMacro ctermfg=magenta381 382syn sync minlines=200383syn sync maxlines=500384 385let b:current_syntax = "rust"386 387" vim: set et sw=4 sts=4 ts=8:388 