3 ms·
If your project doesn't use Grunt, but you do use Vim, you can put the following in your .vimrc " Remove trailing whitespace for everything but markdown.
by reledi 12y ago
If your project doesn't use Grunt, but you do use Vim, you can put the following in your .vimrc
" Remove trailing whitespace for everything but markdown.
let whitespace_blacklist = ['markdown']
autocmd BufWritePre * if index(whitespace_blacklist, &ft) < 0 | :%s/\s\+$//e
There's also several ways to use Git for removing trailing whitespace, if you prefer that.