File tree Expand file tree Collapse file tree 3 files changed +31
-7
lines changed Expand file tree Collapse file tree 3 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 1
1
*rust.txt* Filetype plugin for Rust
2
2
3
3
==============================================================================
4
- CONTENTS * rust*
4
+ CONTENTS *rust* *ft- rust*
5
5
6
6
1. Introduction | rust-intro |
7
7
2. Settings | rust-settings |
@@ -53,6 +53,18 @@ g:rust_conceal_pub~
53
53
let g:rust_conceal_pub = 1
54
54
<
55
55
56
+ *g:rust_fold*
57
+ g:rust_fold~
58
+ Set this option to turn on | folding | : >
59
+ let g:rust_fold = 1
60
+ <
61
+ Value Effect ~
62
+ 0 No folding
63
+ 1 Braced blocks are folded. All folds are open by
64
+ default.
65
+ 2 Braced blocks are folded. 'foldlevel' is left at the
66
+ global value (all folds are closed by default).
67
+
56
68
*g:rust_bang_comment_leader*
57
69
g:rust_bang_comment_leader~
58
70
Set this option to 1 to preserve the leader on multi-line doc comments
Original file line number Diff line number Diff line change 2
2
" Description: Vim syntax file for Rust
3
3
" Maintainer: Chris Morgan <me@chrismorgan.info>
4
4
" Maintainer: Kevin Ballard <kevin@sb.org>
5
- " Last Change: May 27 , 2014
5
+ " Last Change: Jul 07 , 2014
6
6
7
7
if exists (" b:did_ftplugin" )
8
8
finish
@@ -35,7 +35,9 @@ silent! setlocal formatoptions+=j
35
35
" otherwise it's better than nothing.
36
36
setlocal smartindent nocindent
37
37
38
- setlocal tabstop = 4 shiftwidth = 4 expandtab
38
+ setlocal tabstop = 4 shiftwidth = 4 softtabstop = 4 expandtab
39
+
40
+ setlocal textwidth = 99
39
41
40
42
" This includeexpr isn't perfect, but it's a good start
41
43
setlocal includeexpr = substitute (v: fname ,' ::' ,' /' ,' g' )
93
95
" Cleanup {{{1
94
96
95
97
let b: undo_ftplugin = "
96
- \s etlocal formatoptions < comments < commentstring < includeexpr < suffixesadd <
98
+ \ setlocal formatoptions < comments < commentstring < includeexpr < suffixesadd <
99
+ \| setlocal tabstop < shiftwidth < softtabstop < expandtab < textwidth <
97
100
\| if exists (' b:rust_original_delimitMate_excluded_regions' )
98
101
\| let b: delimitMate_excluded_regions = b: rust_original_delimitMate_excluded_regions
99
102
\| unlet b: rust_original_delimitMate_excluded_regions
Original file line number Diff line number Diff line change 3
3
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
4
4
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
5
5
" Maintainer: Chris Morgan <me@chrismorgan.info>
6
- " Last Change: 2014 Feb 27
6
+ " Last Change: July 06, 2014
7
7
8
8
if version < 600
9
9
syntax clear
10
10
elseif exists (" b:current_syntax" )
11
11
finish
12
12
endif
13
13
14
+ " Fold settings {{{1
15
+
16
+ if has (" folding" ) && exists (' g:rust_fold' ) && g: rust_fold != 0
17
+ setlocal foldmethod = syntax
18
+ if g: rust_fold == 2
19
+ setlocal foldlevel <
20
+ else
21
+ setlocal foldlevel = 99
22
+ endif
23
+ endif
24
+
14
25
" Syntax definitions {{{1
15
26
" Basic keywords {{{2
16
27
syn keyword rustConditional match if else
@@ -213,8 +224,6 @@ syn keyword rustTodo contained TODO FIXME XXX NB NOTE
213
224
" Trivial folding rules to begin with.
214
225
" TODO: use the AST to make really good folding
215
226
syn region rustFoldBraces start =" {" end =" }" transparent fold
216
- " If you wish to enable this, setlocal foldmethod=syntax
217
- " It's not enabled by default as it would drive some people mad.
218
227
219
228
" Default highlighting {{{1
220
229
hi def link rustDecNumber rustNumber
You can’t perform that action at this time.
0 commit comments