Moon Light Box

Time is Money

Vim - Highlight Trailing Whitespace

| Comments

During Vim editing, We must have to delete unnecessary trailing whitespace which make code easy to read or merge.

So you can add .vimrc file in /YOUR_HOME_PATH/

$ cd
$ vim .vimrc

Add below contents then save and exit.

hi Whitespace ctermbg=darkred guibg=darkcyan
autocmd BufEnter * if &ft != 'help' | match Whitespace /\s\+$/ | endif
autocmd BufEnter * if &ft == 'help' | match none /\s\+$/ | endif

Enjoy it.

Reference : vim 顯示多餘空白( trailing whitespace )


comments powered by Disqus