Pimping Vim on Windows - WezM.net by Wesley Moore

Pimping Vim on Windows

Published on

Following Nick Kreeger’s handy post on tweaking MacVim on Mac OS X I applied some of the tips to GVim under Windows to make it a little easier on the eye. The following settings are placed in your _vimrc/.vimrc file.

First up is a change of font. With the introduction of Windows Vista Microsoft had a set of new standard fonts created. These also ship with the latest versions of Office. The Consolas monospaced font makes a good programmers font so I use this as the font when running under Windows. I’ve also set the size to be relatively small.

if has("gui_win32")
    :set guifont=Consolas:h8,ProggyTiny:h8,Luxi_Mono:h12:cANSI

Next up set the window to start tall and a little wider than normal:

set columns=90 lines=65

I share my vim config with Cygwin and Windows native vim. In order to get the Windows version to pick up the UNIX plugins etc in the .vim I include the following:

" Make Windows use my UNIX vimfiles
if has("win32")
    set runtimepath=$HOME/.vim,$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after

Turn on a custom status line which includes the file name, file type, modified and read only status, line and column numbers and the percentage through the file.

set laststatus=2
set statusline=%<%f\ %m%a%=%([%R%H%Y]%)\ %-19(%3l\ of\ %L,%c%)%P
set showcmd

Along the lines of what Nick did I turned line numbers on and toned the colour down a bit:

colorscheme koehler
hi LineNr guifg=#666666
set number

So what does it all like in the end? Still not as good as MacVim but not too bad (click for full size version, scaled version looks a bit average):

Screenshot of GVim on Windows after customisation

Comment icon Stay in touch!

Follow me on Twitter or Mastodon, subscribe to the feed, or send me an email.