Geek Lair

Customizing vim

leave a comment »

You can set additional options in vim to make your programming life easier. You can add these options to .vimrc in your home folder so that they are loaded every time you start vim.

vim ~/.vimrc

set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
syntax on
colo murphy

To know what each option does,  just type:

:help <option>

For example to know about autoindent, type:

:help autoindent

gvim

By default, gvim uses courier font. To set your own font, create a file .gvimrc in your home and add set guifont option:

vim ~/.gvimrc

set guifont=Bitstream\ Vera\ Sans\ Mono\ 9

Another useful option is to set the window size:

set lines=100 columns=130

Note that gvim reads options from .vimrc as well. But vim will not read options from .gvimrc

Other resources of interest

Advertisements

Written by anonir

October 26, 2009 at 18:04

Posted in Linux

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: