Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " remove non breaking spaces
- highlight NBSP ctermbg=red guibg=red
- match NBSP /\%u00a0/
- autocmd BufWinEnter * match NBSP /\%u00a0/
- autocmd InsertEnter * match NBSP /\%u00a0/
- autocmd InsertLeave * match NBSP /\%u00a0/
- autocmd BufWinLeave * call clearmatches()
- autocmd BufWritePre * %s/\%u00a0/\ /ge
- " highlight trailing space
- highlight ExtraWhitespace ctermbg=red guibg=red
- match ExtraWhitespace /\s\+$/
- autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
- autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
- autocmd InsertLeave * match ExtraWhitespace /\s\+$/
- autocmd BufWinLeave * call clearmatches()
- autocmd BufWritePre * %s/\s\+$//e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement