TABs (was: Waffling between Python and Ruby)

Rod Haper rhaper at houston.rr.com
Fri Jun 16 23:55:52 EDT 2000


Courageous wrote:
> 
> Well, speaking of tabs, in vim (.vimrc), I have:
> 
> set tabstop=4
> set expandtab
> 
> This sets up vim to "on tab, take the cursor to the
> next appropriate tabstop, but to insert spaces instead
> of tabs when doing so". This is always just what I
> want.

I used to set the tabstop option to 4 (my preference also) in vim but it could really be confusing when I'd edit a file that someone else had written using a mixture of tab characters and spaces to format their indentation levels.  Then I found a much better solution by using the softtabstop option.  Now I use

set expandtab
set softtabstop=4
set shiftwidth=4

This leaves the tabstop option set at it's default 8 characters, keeps the indentation spacing consistent (and sane) for mixtures of tabs and spaces, and let's me use my preferred indentation spacing of 4 spaces.

Rod



More information about the Python-list mailing list