Skip to content

Commit

Permalink
Adding switch in vim plugin to toggle format opts
Browse files Browse the repository at this point in the history
  • Loading branch information
juxiliary committed Nov 19, 2014
1 parent e09d986 commit 62a2a1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/etc/vim/doc/rust.txt
Expand Up @@ -53,6 +53,15 @@ g:rust_conceal_pub~
let g:rust_conceal_pub = 1
<

*g:rust_recommended_style*
g:rust_recommended_style~
Set this option to enable vim indentation and textwidth settings to
conform to style conventions of the rust standard library (i.e. use 4
spaces for indents and sets 'textwidth' to 99). This option is enabled
by default. To disable it: >
let g:rust_recommended_style = 0
<

*g:rust_fold*
g:rust_fold~
Set this option to turn on |folding|: >
Expand Down
7 changes: 4 additions & 3 deletions src/etc/vim/ftplugin/rust.vim
Expand Up @@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
" otherwise it's better than nothing.
setlocal smartindent nocindent

setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab

setlocal textwidth=99
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif

" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
Expand Down

5 comments on commit 62a2a1d

@bors
Copy link
Contributor

@bors bors commented on 62a2a1d Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 62a2a1d Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging juxiliary/rust/master = 62a2a1d into auto

@bors
Copy link
Contributor

@bors bors commented on 62a2a1d Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

juxiliary/rust/master = 62a2a1d merged ok, testing candidate = f530aa0

@bors
Copy link
Contributor

@bors bors commented on 62a2a1d Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 62a2a1d Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f530aa0

Please sign in to comment.