How do I create Vim syntax highlighting rules that are common to all filetypes?
问题 I'm trying to highlight trailing whitespace in vim, regardless of filetype. I'm able to do it on a per-filetype basis. For example, for HTML: ~/.vim/ftplugin/html.vim color html ~/.vim/syntax/html.vim syn match TrailingSpace display excludenl /\s\+$/ ~/.vim/colors/html.vim hi TrailingSpace ctermbg=52 ~/.vimrc syntax on filetype on filetype plugin on These settings make it so that trailing spaces at the end of a line are highlighted with a red background. (They also override all of vim's built