Skip to content

Commit

Permalink
Remove rust_colorcolumn, set textwidth to 99
Browse files Browse the repository at this point in the history
The latest change to aturon/rust-guidelines states that lines must not
exceed 99 characters. This gets rid of the 80/100 split, so we don't
need to customize colorcolumn amymore.
  • Loading branch information
lilyball committed Jul 8, 2014
1 parent 94cfd1b commit 9dc667d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
6 changes: 0 additions & 6 deletions src/etc/vim/doc/rust.txt
Expand Up @@ -34,12 +34,6 @@ g:rustc_makeprg_no_percent~
let g:rustc_makeprg_no_percent = 1
<

*g:rust_colorcolumn*
g:rust_colorcolumn~
Set this option to use 'colorcolumn' to highlight the text width
indicate the 100 column recommended hard limit on line lengths: >
let g:rust_colorcolumn = 1
<
*g:rust_conceal*
g:rust_conceal~
Set this option to turn on the basic |conceal| support: >
Expand Down
23 changes: 2 additions & 21 deletions src/etc/vim/ftplugin/rust.vim
Expand Up @@ -2,7 +2,7 @@
" Description: Vim syntax file for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: July 06, 2014
" Last Change: Jul 07, 2014

if exists("b:did_ftplugin")
finish
Expand Down Expand Up @@ -37,22 +37,7 @@ setlocal smartindent nocindent

setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab

" Line lengths {{{2

" Rust style conventions for line lengths say you SHOULD not go over 80
" columns and MUST not go over 100.
" Without a good 'formatexpr' we can't automatically wrap code, but we can
" still wrap comments just fine with 'textwidth'.
setlocal textwidth=80

" We can also use 'colorcolumn' to highlight both the 80 and 100 limits. Not
" everyone likes this so it's gated.
if exists('g:rust_colorcolumn')
setlocal colorcolumn=+1,101
let b:rust_colorcolumn=1
endif

" }}}2
setlocal textwidth=99

" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
Expand Down Expand Up @@ -112,10 +97,6 @@ endif
let b:undo_ftplugin = "
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|if exists('b:rust_colorcolumn')
\|setlocal colorcolumn<
\|unlet b:rust_colorcolumn
\|endif
\|if exists('b:rust_original_delimitMate_excluded_regions')
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
\|unlet b:rust_original_delimitMate_excluded_regions
Expand Down

5 comments on commit 9dc667d

@bors
Copy link
Contributor

@bors bors commented on 9dc667d Jul 16, 2014

Choose a reason for hiding this comment

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

saw approval from chris
at lilyball@9dc667d

@bors
Copy link
Contributor

@bors bors commented on 9dc667d Jul 16, 2014

Choose a reason for hiding this comment

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

merging kballard/rust/more_vim_tweaks = 9dc667d into auto

@bors
Copy link
Contributor

@bors bors commented on 9dc667d Jul 16, 2014

Choose a reason for hiding this comment

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

kballard/rust/more_vim_tweaks = 9dc667d merged ok, testing candidate = 316719e6

@bors
Copy link
Contributor

@bors bors commented on 9dc667d Jul 16, 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 = 316719e6

Please sign in to comment.