The Fugue

Counterpoint by Hans Fugal

gvim on OS X

Posted by Hans Fugal Mon, 19 Feb 2007 01:18:00 GMT

In spite of being the author of one of the more (in)famous vim color schemes, desert.vim, I have been vimming primarily in the console for quite some time now. The primary reason is that gvim on OS X sucks.

Still, it's nice to have gvim working for various reasons. One of the more important reasons is dragging stuff to the Vim icon on the dock.

As a follow-up to my post on unicode in the terminal, I decided to install the latest Vim.app from macvim.org and see how it handled unicode. It didn't handle it very well, but it's only a few settings away.

First, there's the issue of font. I don't like Monaco very much. I use Anonymous for the terminal and I think it is an excellent font. In fact, I find myself likeing Anonymous just as much as Terminus, but it has the added advantage of being TrueType and looking great with antialiasing. Unfortunately, in Vim at least it looks terrible without antialiasing. So I got the pseudo-TrueType Terminus font by Eric Cheng. It took some fiddling, because of various Bad Things™ happening with Vim and OS X dealing with a TrueType-wrapped bitmap font, but I found the following settings work great (put them in ~/.gvimrc):

set enc=utf-8
set macatsui noanti gfn=Terminus:h12

It's not antialiased, but it is Terminus and it handles Unicode just fine (as far as the Terminus font itself does, which is pretty good).

You can use antialiased fonts, e.g. Anonymous, with the following .gvimrc:

set enc=utf-8
set nomacatsui anti termencoding=macroman gfn=Anonymous:h10

but Bad Things™ happen when you use Unicode, so I'm sticking with the Terminus setup.

Posted in | no comments |