From 3378f6d568df061152129028fbae0dc77509f892 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sat, 11 Dec 2021 14:13:30 +0100 Subject: [PATCH] chore(vim): add custom function to show colorline --- nvim/functions.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nvim/functions.vim b/nvim/functions.vim index e038222..bdff81b 100644 --- a/nvim/functions.vim +++ b/nvim/functions.vim @@ -19,6 +19,21 @@ function! ToggleWrap() endif endfunction +" Toggle between soft wrap and no wrap +nnoremap cw :call ToggleColorColumn() + +function! ToggleColorColumn() + if &colorcolumn == "80" + echo "Textwidth OFF" + set colorcolumn=0 + set textwidth=0 + else + echo "Textwidth ON" + set colorcolumn=80 + set textwidth=80 + endif +endfunction + " Automatic Tabular.vim with the (|) inoremap :call align()a