These are made special by syntax files that Vim relies on to style various items within a source code.
For example on my machine, following default syntax file for C, (which is sourced by C++ syntax file too), contains the line
file: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/c.vim
syn keyword cTodo contained TODO FIXME XXX
Color and styling for cTodo
, if you search would be defined within c.vim
file.
For C++ the file name is cpp.vim
, which sources (includes) c.vim
Why these keywords?
We'll I didn't research much, but programmers started to put attention catching prefixes to their comments, so that they (or someone else) can come to that area of code later (for whatever reason, as stated in the comment). Editors, like Vim, noticed this and added syntax highlighting for these prefixes to make them stand-out even more.
For that matter, most of the editors today have editable (or customizable) syntax highlighting. You can add your own keywords that you want highlighted in comments! (for other keywords/tokens too).