Skip to content

Commit 3c4b32c

Browse files
committed
auto merge of #6259 : Aatch/rust/vimfile, r=bstrie
`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.
2 parents d35eb6e + 80b2926 commit 3c4b32c

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/etc/vim/after/ftplugin/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"Highlight the 100th text column
22
"Feature became available in v7.3
33
if version >= 703
4-
set colorcolumn=100
4+
setlocal colorcolumn=100
55
endif

src/etc/vim/after/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists('g:no_rust_conceal') || !has('conceal') || &enc != 'utf-8'
1+
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
22
finish
33
endif
44

src/etc/vim/indent/rust.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ if exists("b:did_indent")
55
endif
66

77
let b:did_indent = 1
8-
setlocal smartindent
8+
9+
setlocal cindent
10+
setlocal cinoptions=L0,(0,Ws,JN
11+
setlocal cinkeys=0{,0},!^F,o,O

src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
2929
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3030

3131
" Reserved words
32-
syn keyword rustKeyword m32 m64 m128 f80 f16 f128 be
32+
"syn keyword rustKeyword m32 m64 m128 f80 f16 f128 be " These are obsolete
3333

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

0 commit comments

Comments
 (0)