Skip to content

Don't override the users indentation and textwidth #19095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Nov 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/etc/vim/doc/rust.txt
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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