I'm currently using zenburn on android studio (java) and it looks very colorful (note: I'm using iTerm2.. not sure if that changes anything)

enter image description here

but if I add zenburn color to my vimrc, the same file looks a lot less colorful on vi:

enter image description here

how do I fix this? I really wanna do all my editing on vi.


I installed cSyntaxAfter and there was an improvement:

enter image description here

But I still believe there is more than can be done.. ideas?


The first thing to note is that Zenburn is a Vim colour scheme that has been ported to other editors, and that, judging by the screenshot you've posted, the port to Android Studio is an unusual one — it doesn't look much like it usually does:

Zenburn screenshot

The results in your other screenshots are just a combination of Vim's fairly sparse standard Java syntax elements, Zenburn's particular choices for the colouring of these, and the fact that the sections of file that you've screenshotted happen not to include any of the more colourfully-highlighted elements.

Try adding a comment or a string to see a bit more colour, or type :hi (and then page down a few times) to see all the Java syntax elements and their current highlighting.

If you want to alter the colouring of particular elements whilst staying within the Zenburn colour scheme, one easy way to do so is with a command like:

:highlight link javaScopeDecl Error

Where the Error is another syntax item from the output you've just seen that you like the colouring of. The exact command above isn't one I'd necessarily recommend, but it'll certainly show up in the code that you've provided screenshots of!

There are various conversations online that discuss improving Vim's default Java syntax highlighting. Here's one you may have already seen. Here's another.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.