I wanted to highlight all occurence of TODO and NOTE in my code.Looking on the internet, I inserted the following code in my .vimrc:match GruvboxGreenBold /NOTE/:2match ErrorMsg /TODO/This seemed to work fine at first. When I open a file with gvim, the syntax highlights correctly.However, as soon as I split my screen and the file appears twice, the second one get the correct highlighting but the first one loses it.It repeats whenever I open a new buffer.Here's a screenshot Does anyone know how to correct this behavior ?
Highlighting with :match does not appear in all buffers
syntax highlighting;gvim
From :help :match:    Note that highlighting the last used search pattern with    'hlsearch' is used in all windows, while the pattern defined    with :match only exists in the current window.  It is kept    when switching to another buffer.It seems that the highlighting created by :match is local to the current window, not to the current buffer. When you split your screen, you create a new window, so you probably have to reapply your highlighting.  If you want :match and :2match to be automatically executed whenever you launch Vim or enter a new window, you could install the following autocmd:augroup custom_highlighting    autocmd!    autocmd VimEnter,WinEnter * match GruvboxGreenBold /NOTE/ | 2match ErrorMsg /TODO/augroup END