I consider myself an intermediate user of Vim. I use it for nearly all of my editing now-a-days, but still have troubles remembering some commands and enjoy learning new ones. The advantage to knowing these is that you can perform many more actions in vim without having to take your fingers off the keyboard. In most versions of GVim they have the menu items showing the equivalent vim command to the right. This is very useful for learning vim. Here’s an example in GVim on Ubuntu.
I work on a Mac and MacVim doesn’t support these commands entirely. Mostly because MacOS didn’t support custom NSMenuItems until 10.5. So MacVim only shows the keystroke for these commands, not the actual command itself. In order to see the command, you have to mouse over the menu item then wait for the tooltip to show it to you.
Since MacOS supports an NSMenuItem with a custom view, I thought I’d try to implement this in MacVim. Each of the menu items now have the vim command as well as the keystroke in MacOS (if it has one).
I still have some issues with the alignment of a few items. I will probably end up rewriting most of it to use Objective-C categories rather than subclassing NSMenu and NSMenuItem. And I may change the command to use a fixed-width font. But here’s the branch on Github in all it’s gory glory.









