From 8c8048ebcb28ce018b873fa3566c71030e443988 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Jul 2021 00:15:57 +0000 Subject: [PATCH] vim: Add several useful/common FileType configs Unconditionally enable ColorColumn. Any vim without it is not worth using anyway. Signed-off-by: Joe Groocock --- vim/vimrc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 7a7d1ab..a1d4f61 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -73,11 +73,8 @@ set list set listchars=eol:$,space:·,tab:>-,trail:◦,extends:▶,precedes:◀ highlight SpecialKey ctermfg=8 -if exists('+colorcolumn') - highlight ColorColumn ctermbg=8 - autocmd filetype c,h,cpp,hpp set colorcolumn=81 - autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+' -endif +set cc=+1 +highlight ColorColumn ctermbg=8 " Highlight line and column of cursor set cul cuc @@ -304,6 +301,11 @@ cmap w!! w !sudo tee > /dev/null % map Q -autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et -autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et indentkeys-=<:> -autocmd FileType gitcommit setlocal cc=72 et sw=4 +autocmd FileType c setlocal noet +autocmd filetype c,h,cpp,hpp set colorcolumn=81 +autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+' + +autocmd FileType jinja setlocal sts=2 sw=2 et +autocmd FileType markdown setlocal sts=2 sw=2 et +autocmd FileType yaml setlocal sts=2 sw=2 et indentkeys-=<:> +autocmd FileType gitcommit setlocal tw=72 et sw=4