In the VIM editor, you can always highlight individual words?

A few words, such as TODO , are always stored in VIM.

Can I add some custom words to this list that I always want to highlight?

+4
source share
2 answers

Todo is a syntax group , :h group-nameto check the details.

If you want to highlight a few words / text, you can either edit the syntax file or create your own hi-groups ( :h highlight-groups) and add a match.

For instance:

You can make the match todo /!Important!/text !Important!highlight the same as TODO. Or:

hi! Important ctermbg=red guibg=red

hi- Important.

:

:match Important /!Important!/

!Important! , .

vimrc.

+5

match. . ( foo):

:match <highlight-group> "foo"
:match error "foo"  // highlights foo as red.
:match Tag "foo"    // highlights foo to orange

:highlight, . , :help match.

+2

Source: https://habr.com/ru/post/1569282/


All Articles