Variable name highlighting for Java under Vim
The latest version of the java.vim
syntax file for Vim that I can find doesn't do variable name highlighting (i.e. pants
in String pants = "trousers";
).
Emacs can do this. There has to be a way.
Without digging deep and learning some of the deep 开发者_开发知识库dark magic is there any way I can get these pieces of code highlighted?
Have a look at my ctags highlighting plugin. It hasn't had lots of testing with Java, but it should be able to do what you want.
For local variable highlighting, you'll need to do let g:TypesFileIncludeLocals = 1
.
Note, however, that there is sadly no practical way in Vim to have very detailed context highlighting, so the variable will be highlighted wherever it is used, rather than just in the function it is declared.
精彩评论