Skip to content

Commit

Permalink
auto merge of #6259 : Aatch/rust/vimfile, r=bstrie
Browse files Browse the repository at this point in the history
`colorcolumn` is now set with `setlocal`, so it doesn't infect the entire session.

`conceal` support is now opt-in, not opt-out. I haven't found anybody that likes it or cares either way.

The indent file now uses `cindent` with appropriate `cinoptions` and `cinkeys`. Auto-indenting an entire file mostly gets the right thing now, with structs and enums not being affects like before. Defaults to the hanging indent style, unless the first argument is on a new line.

There were some keywords in the syntax file that I've never seen (and have been used as identifiers in some tests) so they have been commented out.
  • Loading branch information
bors committed May 8, 2013
2 parents d35eb6e + 80b2926 commit 3c4b32c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/etc/vim/after/ftplugin/rust.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"Highlight the 100th text column
"Feature became available in v7.3
if version >= 703
set colorcolumn=100
setlocal colorcolumn=100
endif
2 changes: 1 addition & 1 deletion src/etc/vim/after/syntax/rust.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if exists('g:no_rust_conceal') || !has('conceal') || &enc != 'utf-8'
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
finish
endif

Expand Down
5 changes: 4 additions & 1 deletion src/etc/vim/indent/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ if exists("b:did_indent")
endif

let b:did_indent = 1
setlocal smartindent

setlocal cindent
setlocal cinoptions=L0,(0,Ws,JN
setlocal cinkeys=0{,0},!^F,o,O
2 changes: 1 addition & 1 deletion src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained

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

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

0 comments on commit 3c4b32c

Please sign in to comment.