Stop being fancy with colorcolumn

This commit is contained in:
Anthony Rose 2022-04-08 14:25:22 +00:00
parent 3deb8b4b54
commit 19bcab85fd

16
vimrc
View file

@ -55,6 +55,7 @@ set autoread
set background=dark set background=dark
set backspace=indent,eol,start set backspace=indent,eol,start
set cmdheight=1 set cmdheight=1
set colorcolumn=73,81
set directory=$TEMP//,/tmp//,. set directory=$TEMP//,/tmp//,.
set display+=lastline set display+=lastline
set encoding=utf-8 set encoding=utf-8
@ -160,21 +161,6 @@ if has('autocmd')
autocmd BufRead,BufNewFile *.xml set et sw=2 autocmd BufRead,BufNewFile *.xml set et sw=2
autocmd BufRead,BufNewFile *.yaml set et sw=2 autocmd BufRead,BufNewFile *.yaml set et sw=2
autocmd BufRead,BufNewFile *.yml set et sw=2 autocmd BufRead,BufNewFile *.yml set et sw=2
" Set the colorcolumn to textwidth + 1.
function! s:SetColorColumn()
if &textwidth == 0
setlocal colorcolumn=81
else
setlocal colorcolumn=+1
endif
endfunction
augroup colorcolumn
autocmd!
autocmd OptionSet textwidth call s:SetColorColumn()
autocmd BufEnter * call s:SetColorColumn()
augroup end
endif endif
if has('folding') if has('folding')