diff options
author | Linnnus <[email protected]> | 2023-09-22 15:56:43 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-09-22 15:57:14 +0200 |
commit | 340f15a96b4352b057a1ee4e2e9b371aaa02ae23 (patch) | |
tree | 56bc7bffc54aa2b688c7ce1b27b5aec28569bdec /home/neovim/init.vim | |
parent | 55f7919a2191e161cf25a664df8bb90923f00711 (diff) |
Highlight sus WS in NVIM
Diffstat (limited to 'home/neovim/init.vim')
-rw-r--r-- | home/neovim/init.vim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/home/neovim/init.vim b/home/neovim/init.vim index 7d99474..43b1f24 100644 --- a/home/neovim/init.vim +++ b/home/neovim/init.vim @@ -186,12 +186,13 @@ au BufReadPost * \ exe "normal! g'\"" | \ endif -" FIXME: disable in insertmode -augroup HighlightSusWhitespace +" TODO: Ignore in term:// buffers. +augroup Sus au! - " Whenever a colorscheme clears the highlighting, re-add our own rule - au ColorScheme * hi SusWhitespace ctermbg=red guibg=red - " Whenever a new window is created, create our matches - au VimEnter,WinNew * match SusWhitespace /\s\+$/ - \ | 2match SusWhitespace /\%u00A0/ + au VimEnter,ColorScheme * hi SusWhitespace ctermbg=red guibg=red + au BufWinEnter * match SusWhitespace /\s\+$/ + \ | 2match SusWhitespace /\%u00A0/ + au InsertEnter * match SusWhitespace /\s\+\%#\@<!$/ + au InsertLeave * match SusWhitespace /\s\+$/ + au BufWinLeave * call clearmatches() augroup END |