sabato 10 marzo 2012

Vim - How to set TAB key to 4 spaces

To use Vim as editor (for python in my case) is better to set the tab space to 4 spaces instead the default 8 spaces.
Its pretty simple to do.
In Ubuntu 10.10 and similar simple add this 4 lines to /etc/vim/vimrc :


Open the file..

user@box:~$ sudo vi /etc/vim/vimrc


append these lines:

"--------Setting for 4 spaces TAB key------
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
"---------End of setting -----------------


Save and restart Vim and it should work.

Nessun commento:

Posta un commento