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. I code in C++ and since the function call and class names can't be highlighted, the code is more difficult to read. I played with color scheme for a bit, but couldn't find any field that corresponded to "class name" or "function name".
In the picture below, notice how DroughtLayer::
and *.size()
is not highlighted on the right in MacVim.
Picture comparison between Textmate(left) and Vim(right) http://ivzhao.com/temp/vimHL.png
Any ideas how to solve this? It really annoys me as I am so much a visual-sensitive guy.
The
Clighter
plugin can also be considered, which is aHowever, requires fairly recent versions and software:
vim 7.4.330 +python2
andlibclang
.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.
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
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.
Use a plug-in for vim like Taglist or set up
ctags
orcscope
integration with vim (here's a tutorial for the vim/cscope.)