Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Settings in VIM

Status
Not open for further replies.

blues77

Programmer
Jun 11, 2002
230
CA
Hello,

I am using the Windows GUI version of VIM and I've added the following settings to the configuration file.
set nowrap
set ts=4
set ai
set si

Now my problem is when I type something like
function()
{<- `and I hit return here'
*<- `it brings me way dowm here`
*<- ` but I want to be tabbed in this far`

is there any setting in the config file that would make VIM know that it is only supposted to tab in 4 spaces from the `{` on the next line. It's very fustrating having to backspace all the time. Any and all help is greatly appreciated!!!

Thanks


 
Put the following line in your [tt]~/.vimrc[/tt]:
Code:
set shiftwidth=[COLOR=red]4[/color]
Replace "4" with the number of spaces you like for indentation.

For more info on advanced indentation control, type the following colon command:
Code:
:help 30.2


Also, unless you're really attached to certain Vi quirks, I suggest putting this line in your config file:
Code:
set nocompatible
That'll keep Vim from trying to be overly compatible with Vi and get you a bunch of useful Vim improvements like multiple undos.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top