In vim, how do I highlight TODO: and FIXME:?

后端 未结 3 1943
死守一世寂寞
死守一世寂寞 2020-12-23 01:52

In vim, FIXME and TODO are highlighted, but I can\'t get FIXME: and TODO: (note the colon after the keyword) to highlight? What should I put in my .vimrc to make this happen

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 02:42

    augroup vimrc_todo
        au!
        au Syntax * syn match MyTodo /\v<(FIXME|NOTE|TODO|OPTIMIZE|XXX):/
              \ containedin=.*Comment,vimCommentTitle
    augroup END
    hi def link MyTodo Todo
    

    The containedin will add it to all groups ending in "Comment", plus vimCommentTitle, where " TODO: foo would not get highlighted as MyTodo otherwise.

提交回复
热议问题