开发者

Variable name highlighting for Java under Vim

开发者 https://www.devze.com 2023-02-14 00:16 出处:网络
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\";).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号