Описание тега vim-syntax-highlighting
Vim has a rich syntax highlighting system. Syntax files can be found via :e $VIMRUNTIME/syntax
and colorschemes can be found in :e $VIMRUNTIME/colors
. These files use special vim commands to color and syntax-highlight different filetypes within vim.
This tag should be used if you have questions specifically about syntax highlighting in vim, since these questions are quite different from standard vim commands and tasks. Make sure you are reporting the correct :echo &filetype
in your question and that you have set :syntax on
.
If you are trying to add syntax highlighting to a non-standard filetype, then place the downloaded syntax in your ~/.vim/syntax
folder and name it <filetype>.vim
. Then in your ~/.vimrc
, use au BufRead,BufNewFile *.<extension> setl ft=<filetype>
where <extension>
is the extension of the filetype and <filetype>
is the name you saved the syntax file as.
For more information on vim syntax highlighting see :help syntax
in vim, which provides some excellent documentation.