-
VIM Question
Anyone know if you can change how much VIM indents when it does auto-indenting? I checked the vimrc file but all I found was the option to turn autoident on or off.
I want to change it from a tab to two spaces. Found the indent directory but not sure which file to change.
Thanks
-
It should be something along the lines of
Code:
:set autoindent tabstop 2
for a two space indention.
-
Thanks Prelude. Unfortunately that didn't do it. Looking through the help and stuff more I found that the setting I'm looking for is called sw. I can change it for that session by doing :set sw=2 but it doesn't change permeantly. I'll keep looking though.
-
>Unfortunately that didn't do it.
I would be able to help better if I were running Unix at the moment. My .rc file for vi sets the autoindent to 2. I'll grab it for you the next time I boot into Unix if you haven't solved your problem by then.
-
Re: VIM Question
>> I want to change it from a tab to two spaces.
I'm not sure I understand your question.
normally I use tab indenting.
if I want to change tab to spaces, I type ``:1,$s/\t/ /g'' before exporting to other editors.
if you mean autoindent with spaces, i don't know. :(
that's very bad for me and might cause me to change my avatar :p
>>:set sw=2 but it doesn't change permanently.
howabout put it in vimrc file?
-
Here's my .vimrc file (used for gvim as well)
Code:
:set guifont=*
:syntax on
:set tabstop=4
:set shiftwidth=4
:set smartindent
:set smarttab
:set expandtab
-
I tested individual command.
seems that only :set expandtab is required.
Thx Hammer :)