]> git.lizzy.rs Git - rust.git/commitdiff
Move vim syntax file, add indent file.
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 18 May 2011 03:35:46 +0000 (20:35 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 18 May 2011 03:35:46 +0000 (20:35 -0700)
src/etc/rust.vim [deleted file]
src/etc/vim/indent/rust.vim [new file with mode: 0644]
src/etc/vim/syntax/rust.vim [new file with mode: 0644]

diff --git a/src/etc/rust.vim b/src/etc/rust.vim
deleted file mode 100644 (file)
index 4ba8512..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-" Vim syntax file
-" Language:     Rust
-" Maintainer:   Patrick Walton <pcwalton@mozilla.com>
-" 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 rec
-syn keyword   rustKeyword     tup tag vec fn iter obj as drop task chan flush
-syn keyword   rustKeyword     spawn if else alt case in do while break cont
-syn keyword   rustKeyword     fail log log_err note claim check prove assert
-syn keyword   rustKeyword     for each ret put be
-
-syn keyword   rustType        any int uint float char bool u8 u16 u32 u64 f32
-syn keyword   rustType        f64 i8 i16 i32 i64 str task
-
-syn keyword   rustBoolean     true false
-
-syn match     rustItemPath    "\(\w\|::\)\+"
-
-syn region       rustString      start=+L\="+ skip=+\\\\\|\\"+ end=+"+
-
-"integer number, or floating point number without a dot and with "f".
-syn case ignore
-syn match        rustNumber            display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
-"hex number
-syn match        rustNumber            display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
-syn match      rustFloat               display contained "\d\+f"
-"floating point number, with dot, optional exponent
-syn match      rustFloat               display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
-"floating point number, starting with a dot, optional exponent
-syn match      rustFloat               display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
-"floating point number, without dot, with exponent
-syn match      rustFloat               display contained "\d\+e[-+]\=\d\+[fl]\=\>"
-
-syn match   rustCharacter   "'[^']*'"
-
-syn case match
-syn region    rustComment     start="/\*" end="\*/"
-syn region    rustComment     start="//" skip="\\$" end="$" keepend
-
-hi def link rustString        String
-hi def link rustCharacter     Character
-hi def link rustNumber        Number
-hi def link rustBoolean       Boolean
-hi def link rustFloat         Float
-hi def link rustKeyword       Keyword
-hi def link rustComment       Comment
-hi def link rustMacro         Macro
-hi def link rustType          Type
-
-let b:current_syntax = "rust"
-
diff --git a/src/etc/vim/indent/rust.vim b/src/etc/vim/indent/rust.vim
new file mode 100644 (file)
index 0000000..0eb96b5
--- /dev/null
@@ -0,0 +1,9 @@
+" Vim indent file
+
+if exists("b:did_indent")
+       finish
+endif
+
+let b:did_indent = 1
+
+setlocal cindent
diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim
new file mode 100644 (file)
index 0000000..4ba8512
--- /dev/null
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language:     Rust
+" Maintainer:   Patrick Walton <pcwalton@mozilla.com>
+" 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 rec
+syn keyword   rustKeyword     tup tag vec fn iter obj as drop task chan flush
+syn keyword   rustKeyword     spawn if else alt case in do while break cont
+syn keyword   rustKeyword     fail log log_err note claim check prove assert
+syn keyword   rustKeyword     for each ret put be
+
+syn keyword   rustType        any int uint float char bool u8 u16 u32 u64 f32
+syn keyword   rustType        f64 i8 i16 i32 i64 str task
+
+syn keyword   rustBoolean     true false
+
+syn match     rustItemPath    "\(\w\|::\)\+"
+
+syn region       rustString      start=+L\="+ skip=+\\\\\|\\"+ end=+"+
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match        rustNumber            display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match        rustNumber            display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+syn match      rustFloat               display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match      rustFloat               display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match      rustFloat               display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match      rustFloat               display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+
+syn match   rustCharacter   "'[^']*'"
+
+syn case match
+syn region    rustComment     start="/\*" end="\*/"
+syn region    rustComment     start="//" skip="\\$" end="$" keepend
+
+hi def link rustString        String
+hi def link rustCharacter     Character
+hi def link rustNumber        Number
+hi def link rustBoolean       Boolean
+hi def link rustFloat         Float
+hi def link rustKeyword       Keyword
+hi def link rustComment       Comment
+hi def link rustMacro         Macro
+hi def link rustType          Type
+
+let b:current_syntax = "rust"
+