Table of Contents

VIM - Custom Syntax Highlighting

Get existing Syntax Highlighting

To get an exhaustive, color-coded list showing what patterns and keywords are mapped to what classes:

:syntax

syntax.vim
syntax keyword cFunction abort
syntax keyword cFunction abs
syntax keyword cFunction acos
syntax keyword cFunction acosh
syntax keyword cFunction alarm
...
...
highlight link cFunction Function

NOTE:

  • The top few lines designate certain keywords as belonging to the cFunction class.
  • The line at the bottom links the cFunction class to the universal class Function.

Load the Syntax file

:so ~/.vim/syntax.vim

Keybinding to perform the load of the Syntax file

nmap + :so ~/.vim/syntax.vim

NOTE: Typing the plus key in normal mode in Vim, will load the custom syntax highlighting rules, based on what language is currently being using.


References

https://github.com/octol/vim-cpp-enhanced-highlight/blob/master/after/syntax/c.vim

https://github.com/octol/vim-cpp-enhanced-highlight