I've found Vim to have fantastic syntax highlighting with my preferred color schemes for Ruby and Python, but whenever I need to write Java code, it's like I haven't even turned on highlighting in the first place.
As you can see, keywords are highlighted, but there's no highlighting for parentheses or methods. In Sublime Text (a far less preferred editor by me), I see far better highlighting. There is italicization for class names and highlighting for mathematical operators. Vim looks sparse in comparison.
Is there any way, any way at all to get that luscious Sublime Text-style highlighting on Vim?
Best Answer
Have a look at the cSyntaxAfter plugin. It highlights operators et cetera.
Another option is to edit the
syntax/java.vim
script and add highlighting for theOperator
group. Have a look atsyntax/pascal.vim
as an example.It you want to use italics for class names, that should be possible if the java syntax file recognizes them as a group, and I think it does. It seems that class names are in the
JavaTypedef
group.You would then have to define a new highlight for that group. That would mean removing the line
from the syntax file, and adding a new one. Below I'm re-using the hightlight declaration for Type, which is what Typedef is linked to. I changed the
term
fromunderline
toitalic
.You should put the following in yout
java.vim
syntax file.