vim: Make trailing space highlighting more subtle

I sometimes work in files where I cannot remove trailing whitespaces (at
least not permanently). In these cases the background highlighting of
them is quite strong and can be a bit annoying. To make this more
pleasing, use the foreground to highlight trailing characters, as long
as tabs and trailing spaces are displayed as non-space characters.

For this I also set `trail` in `&listchars`, and while at it, merged the
two lines setting `&listchars` and cleaned up some comments.
This commit is contained in:
2024-12-04 08:57:00 +01:00
parent cbacf728e6
commit 59f12488b1
2 changed files with 16 additions and 7 deletions

View File

@@ -77,11 +77,11 @@ if (has('cmdline_info'))
endif
" Show whitespace characters
set list
set listchars=tab:>·
" Display tabs and trailing space characters as well an indicator for long lines
" when not wrapping
set listchars=tab:>·,trail,extends:>
" Wrap lines
set wrap
" When wrap is off, show a visual indicator that the lines continues
set listchars+=extends:>
" Keep current line away from top/bottom borders of the buffer when scrolling
set scrolloff=5
" Enable mouse