Hot tip for vim users: highlight spaces at end of lines

Chris Sherlock chris.sherlock79 at gmail.com
Wed Dec 30 17:38:03 PST 2015


Hi all, 

Quick tip I’d like to share - every now and then I accidentally add a space on the end of lines of code. 

You can highlight this occurring in vim by adding the following to your .vimrc file:

highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/

Probably most vi/vim users know this, but to remove newlines, you can use the following:

:%s/ \+$//g

Chris


More information about the LibreOffice mailing list