tabs in vi

Shaun Gordon sgordon at hpindwa.HP.COM
Wed Aug 23 02:19:23 AEST 1989


> Is there a way to make it so that when ever I hit the TAB key
> in 'vi' that I get 4 spaces rather than an actual tab?  I would
> rather not have to run expand after running vi, as I would only
> want to do that if I actually changed the file.

While inside vi you can type a colon to get to the command line and then enter:

set tabstop=4

If you want tabs to default to 4 you should create a file .exrc in you home
directory (if it doesnt already exist) and put the set command in it.  It 
should look like it does above (i.e. no colon.)

By the way, if you want to see what other options you can change in vi, you
can type a colon and then:

set all

and this will show you all of the options.

I hope this helps.

-Shaun



More information about the Comp.unix.questions mailing list