From fc0969abbaf451e54d343027bff4fb5372b773e1 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 22 Mar 2022 16:18:58 +0100 Subject: [PATCH] vim: Drop textwidth autocmd for native way Instead of needing a manual autocmd that triggers on textwidth changes, colorcolumn supports offsets to textwidth natively. --- .config/vim/vimrc.d/30-settings.vim | 6 +++--- .config/vim/vimrc.d/80-autocommands.vim | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.config/vim/vimrc.d/30-settings.vim b/.config/vim/vimrc.d/30-settings.vim index 05b8f7e..68a4440 100644 --- a/.config/vim/vimrc.d/30-settings.vim +++ b/.config/vim/vimrc.d/30-settings.vim @@ -42,9 +42,9 @@ else nmap cW dWi endif " Highlight current line -" set cursorline -" Show ruler at &textwidth columns -let &colorcolumn=&textwidth +"set cursorline +" Show ruler at column behind &textwidth +set colorcolumn=+1 " Show menu for possible matches when using command-line completing. if (has('wildmenu')) set wildmenu diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index 2cd732f..307327f 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -57,9 +57,6 @@ endif " Custom bindings when debugging autocmd SourcePost termdebug.vim tnoremap -" Adjust the colorcolumn together with &textwidth -autocmd OptionSet textwidth exec 'set cc-=' . v:option_old . ' | set cc+=' . &tw -" " Highlight word under cursor augroup highlight_current_word au!