gvim fonts - How to set the default gvim font

Having just downloaded and installed vim (gvim) on my Mac (Mac OS X 10.5.x to be precise), and then struggling for a while to set the default font, I thought I'd make a brief note here about how to set the default font properly.

Setting a default gvim font in the gvimrc file

To set a default font for the gvim editor (in my case on Mac OS X), edit a file named ~/.gvimrc (i.e., a file named .gvimrc in your home directory), and add this line to get a 12-point Monaco font:

set guifont=Monaco:h12

That's all you have to do. The next time you start gvim, it will read this gvimrc configuration setting, and this should be your default gvim font.

.gvimrc versus .vimrc

From the behavior I've seen, the .gvimrc file in your home directory is read by gVim after the .vimrc file is read. I saw this when I was first putting my commands in the ~/.vimrc file, and some of my changes made it through, while others appeared to be overwritten. That's why I'm writing here that you should make your changes in the ~/.gvimrc file.

Credits

Many thanks to the creators of gVim, with special thanks to you for making it available on the Mac platform.