I want to color the background of a keyword but also for the whole line where it is found.
The file has entries like this:
\begin{frame}
\frametitle{title}
\framesubtitle{subtile}
\end{frame}
- Lines with frametitle should be red in background.
- Lines with framesubtitle should get a light blue background.
- Lines that contain otherwise the word frame should get a light gray background
My approach did not succed so far, I have put this into .vimrc:
syntax keyword framesubtike framesubtitle
syntax keyword frametitle frametitle
hi frame term=bold ctermbg=1
What did I miss?
Edit: Thanks to Carpetsmoker's answer this works good enough for now:
syntax region regionone matchgroup=framesubtitlecolorblue start=/^.*framesubtitle.*/ end=/$/
syntax region regiontwo matchgroup=framesubtitlecolorred start=/^.*frametitle.*/ end=/$/
hi framesubtitlecolorblue ctermfg=blue guifg=red
hi framesubtitlecolorred ctermfg=red guifg=red