These are special syntax files that Vim relies on to style various elements in the source code.
For example, on my machine, the following default syntax file for C (which is also obtained by the C ++ syntax file) contains the line
file: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/c.vim
syn keyword cTodo contained TODO FIXME XXX
Color and style for cTodo , if the search is defined in the c.vim file.
For C ++, the name of the cpp.vim file whose sources (including) c.vim
Why are these keywords?
We will not understand much, but programmers began to draw attention to the prefixes of their comments so that they (or someone else) could come to this area of ββthe code later (for some reason, as indicated in the comment). Editors like Vim have noticed this and added syntax highlighting for these prefixes to make them clearer.
In this regard, most editors today have editable (or custom) syntax highlighting. You can add your own keywords that you want to highlight in the comments! (for other keywords and tokens too).
xk0der
source share