Usually trailing whitespace is undesirable. Using vim’s :match
command you can easily highlight those trailing whitespace:
:match Error /\s\+$/
This can be combined with autocmd
and inserted to ~/.vimrc
to highlight trailing whitespace only for certain files:
autocmd Filetype python match Error /\s\+$/
Hey Guy!!
Thanks for the great tip. What is the way to “undo” the command, so that highlighting of such cases is stopped that doesn’t involve resetting vim?
Try
:match none
. You can read more on the match command using:help :match
.