Thursday, July 28, 2011

Changing color scheme and font settings in gvim




I like using vim for quickly loading a file for view/edit etc on my windows m/c. 
At work, with the monitors being 21" in size.. I wanted vim to open up on a larger frame, and also wanted to have some tweaks incorporated (font, color scheme, tab width, etc). I thought I'd simply have to edit my .vimrc from my home directory and voila.. everything should work. Well.. not quite. It works fine for my command line vi invocation from cygwin, but not when I open up from vim. After googling a bit, found few suggestions which satisfied my needs. All you have to do is to edit the _vimrc file which is located in you vim installation folder. For instance, C:\Program Files\Vim 
You can either edit it directly, or open up vim editor and goto Edit -> Startup Settings. Once opened, you can add the settings to the file. In my case, I added the following: 

set tabstop=4
set number
set lines=50
set columns=120

If you need to change the color scheme, chose the color scheme that you liked, and add the following to the _vimrc file:

:color morning

For font settings, choose the font that you like, then type 
:set guifont?
This will display the current font setting information. Note that down and set it to guifont in _vimrc.
Here's mine:

if has ('gui_running') 
 set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI
endif

Happy vimming!! And thanks for those folks who put out this nice little tidbit about vim settings.. 

No comments:

Post a Comment