I come to VIM from Sublime Text 2, and one thing I miss is good syntax highlighting. See this sample of PHP code in both ST2 and Vim... vim doesn't highlight almost anything:


I have syntax on, and syntax files for lot of languages at $HOME/.vim/syntax.
Am I missing something? It's there any plugin to enable better syntax highlighting? Is it the colorscheme I'm using (jellybeans)?
There are two aspects to syntax highlighting:
The first can be shown with :syn list; all those lines starting with php define the PHP syntax. The SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin is also quite helpful to show the syntax group of the current element. The amount of differentiation depends on the used syntax plugin, and there's little you can do about it, but that's usually not the problem.
It's more likely that you're dissatisfied due to the second. Especially in terminal Vim, there are only few colors (maybe only 16) and attributes available. Also, your color scheme probably links multiple highlight groups to a common color (check with :highlight).
You can try out different color schemes. If it's lack of available colors, use GVIM or learn how to configure 256 colors for your terminal. Check what your chosen color scheme supports (some are GUI-only, some support the terminal only poorly), and look into solutions like CSApprox to get more colors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With