Saturday, November 7, 2009

How to change Vim indentation

Indentation is important thing for programmer to write code. Vim is my favorite code editor and by default its indentation is four whitespaces characters. But I 'm prefer to use two whitespaces. So here are my steps to change vim's indentation on my Slackware Linux:

1. Create .vimrc file on your home directory.
2. write these on .vimrc:

set shiftwidth=2
set tabstop=2

3. save file.

Explanations
1. shiftwidth: to control how many whitespace will be indented.
2. tabstop: to control how many whitespace a tab counts for.

Reference: http://tedlogan.com/techblog3.html

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...