I just recently set up my Vim environment from Textmate, after becoming addicted to its modal input.
However, syntax highlighting seems to be not so beautiful in Vim
Try using this plugin http://www.vim.org/scripts/script.php?script_id=2646 Its does all ctags highlighting very efficiently for you
The Clighter plugin can also be considered, which is a
plugin for c-family semantic source code highlighting, based on Clang
However, requires fairly recent versions and software: vim 7.4.330 +python2
and libclang
.
To match C functions definitions only, this works for me:
syn match cCustomFuncDef display /\(\w\+\(\s\|*\)\+\)\@<=\w\+\s*(\@=/
hi def cCustomFuncDef ctermfg=lightblue
EDIT: color_coded may be too heavy for you. try octol/vim-cpp-enhanced-highlight. It supports C++11/14 and integrates what @Eduardo answers.
Semantic based highlighter:
I would recommend jeaye/color_coded,
A vim plugin for libclang-based highlighting
So sorry that i'm new to stackoverflow which means I've not enough reputation to post images. Go see its effects if you wanna give it a shot. :)
Pros:
python2.7
.
However, color_coded is written in C++ and provides lua binding ->
C++.Cons:
Although it's still under development, it's increasingly gaining attention.
Use a plug-in for vim like Taglist or set up ctags
or cscope
integration with vim (here's a tutorial for the vim/cscope.)
The one solution is to use built ctags database. So create one with the ctags utility. Then set the 'tags' variable and put the following to the
~/.vim/after/syntax/c.vim
function! s:highlight()
let list = taglist('.*')
for item in list
let kind = item.kind
if kind == 'f' || kind == 'c'
let name = item.name
exec 'syntax keyword Identifier '.name
endif
endfor
endfunction
call s:highlight()
I must warn you that this can work very slow on the very big ctags database.
Also there is one solution on the vim.org but I didn't try this one. Let me know if it works for you.