How do I persistently highlight specific patterns with custom colors in Vim?
:call matchadd('Search', 'pattern')
The matchadd() function lets you add persistent highlights to patterns without affecting the search register.
:call matchadd('Search', 'pattern')
The matchadd() function lets you add persistent highlights to patterns without affecting the search register.
syntax on
Use syntax on in your vimrc to enable syntax highlighting for all supported file types.
:set incsearch hlsearch
The combination of incsearch and hlsearch gives you live, interactive search highlighting.