diff options
| author | Patrick Walton <[email protected]> | 2010-10-13 10:43:19 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-10-13 10:43:19 -0700 |
| commit | b7e6d9895e1daecf1c113e01186203025098b9a6 (patch) | |
| tree | 9265d493c0af2dd98f71523d30c5dbd5e8c59557 /src/etc/rust.vim | |
| parent | Fix horribly embarassing signedness bug in backend, plus related regressions. (diff) | |
| download | rust-b7e6d9895e1daecf1c113e01186203025098b9a6.tar.xz rust-b7e6d9895e1daecf1c113e01186203025098b9a6.zip | |
First stab at a Vim syntax highlighter for Rust
Diffstat (limited to 'src/etc/rust.vim')
| -rw-r--r-- | src/etc/rust.vim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/etc/rust.vim b/src/etc/rust.vim new file mode 100644 index 00000000..2a5a58b9 --- /dev/null +++ b/src/etc/rust.vim @@ -0,0 +1,35 @@ +" Vim syntax file +" Language: Rust +" Maintainer: Patrick Walton <[email protected]> +" Last Change: 2010 Oct 13 + +" Quit when a syntax file was already loaded +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish + endif + " we define it here so that included files can test for it + let main_syntax='rust' +endif + +syn keyword rustKeyword use meta syntax mutable native mod import export +syn keyword rustKeyword let auto io state unsafe auth with bind type true +syn keyword rustKeyword false any int uint float char bool u8 u16 u32 u64 +syn keyword rustKeyword f32 i8 i16 i32 i64 f64 rec tup tag vec str fn +syn keyword rustKeyword iter obj as drop task port chan flush spawn if +syn keyword rustKeyword else alt case in do while break cont fail log +syn keyword rustKeyword note claim check prove for each ret put be + +syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ + +syn region rustComment start="/\*" end="\*/" +syn region rustComment start="//" skip="\\$" end="$" keepend + +hi def link rustString String +hi def link rustKeyword Keyword +hi def link rustComment Comment + +let b:current_syntax = "rust" + |