Monday, September 13, 2010

Re: Return } to previous indent

On Mon, Sep 13, 2010 at 10:53:20AM +0200, Dotan Cohen wrote:
> I have smartindent set, but I'd like VIM to return to the previous
> indentation (back four spaces) when } (close block) is pressed. Is
> this possible? The terrific Kate (KDE text editor) and even the MS
> Visual Studio series have this wonderful feature.
>
> Thanks.
> Dotan Cohen

You shouldn't use 'smartindent'. Instead add the following to
your vimrc:

filetype plugin indent on

This enables smart indenting (and also file plugins) which works
much better than 'smartindent'.

Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

No comments: