Skip to content

Why doesn't it look like the VIM version?

sellout edited this page Dec 5, 2012 · 2 revisions

I’ve said that the primary goal of this project is to match the VIM version, so why doesn’t it? There are a few possibilities:

Pattern matching is defined differently.

In the editors, each mode defines its own set of patterns for identifying things like functions, variables, comments, etc. The VIM and Emacs definitions probably don’t line up 100%. If one of the editors decides that x should be highlighted as a constant, and the other decides it should be highlighted as a variable, that is an issue to be brought up with the mode authors (which may be the editor authors).

Highlighting is defined differently.

VIM’s set of highlights and Emacs’ face names are not a 1-to-1 mapping. Sometimes two different faces in Emacs are represented by one in VIM, or vice versa. Or they just don’t quite line up the same way. In these case, some approximations need to be made, hopefully maintaining as much of the original intent as possible.

(eshell-ls-directory ((t (,@fg-blue)))) ; Directory

In the above example, I am claiming that eshell-ls-directory should look like VIM’s Directory highlight. The middle section is the definition – I have tried to use names as similar as possible to the VIM ones to make the translation obvious.

It’s a bug!

It might be that some face I thought was unique to Emacs actually exists in VIM somewhere and I failed to find it, or I mis-guessed the intent of a VIM face and used it for the wrong purpose. I try to annotate the Emacs faces with the VIM face that I think most closely matches the purpose, so if an annotation is missing or wrong, that is a bug in this project – please report it.

When reporting a bug, please don’t just post a screenshot and say “why doesn’t this look like VIM?” Screenshots are helpful, but also point to the specific places you think are wrong, and include the faces that are involved (M-x describe-face when the point is on the relevant word will tell you the face name). Try to include the name of the highlight that VIM uses in the same situation, if possible.