aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorclaw0ry <me@claw0ry.net>2025-01-21 16:00:59 +0100
committerclaw0ry <me@claw0ry.net>2025-01-21 16:00:59 +0100
commitb52de610e0584739aa09d425521b7e4f1cfe42cd (patch)
tree80bcdd4c389de6b56e3d790952ee3961f608e2d9 /.vimrc
parentvim: keybinding for copying filename (diff)
vim: highlight nbsp (\xa0) and force white fg on ExtraWhitespace
In addition to highlighting trailing whitespace it also highlights the NBSP character (\xa0). This character is easily mistyped on MacOS. As an extra improvement it force ExtraWhitespace foreground highlighting to be white.
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc6
1 files changed, 3 insertions, 3 deletions
diff --git a/.vimrc b/.vimrc
index 0730119..f76723a 100644
--- a/.vimrc
+++ b/.vimrc
@@ -183,8 +183,8 @@ set background=dark
colorscheme habamax
" highlight extra whitespace
-highlight ExtraWhitespace ctermbg=red guibg=red
-autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
+highlight ExtraWhitespace ctermbg=red guibg=red ctermfg=white guifg=white
+autocmd BufWinEnter * match ExtraWhitespace /\s\+$\|\%xA0/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
-autocmd InsertLeave * match ExtraWhitespace /\s\+$/
+autocmd InsertLeave * match ExtraWhitespace /\s\+$\|\%xA0/
autocmd BufWinLeave * call clearmatches()