On Thu, 24 Aug 2006 10:46:26 +0200, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:
> Kim Schulz wrote:
>>
>> Hi is there a way to make indentation in Vim "lock" like in emacs so
> that if I press tab in the beginning of a line, then it indents the line
> to the correct place. Pressing tab multiple times does not change the
> indentation any further - it is locked.
>
> 'autoindent' will indent the line to the same location as the line the
> cursor was on before hitting Enter in Insert mode, o or O in Normal
> mode, etc.
>
> I suppose that you could force a fixed indent of, say, 6 characters
> (i.e., always indent to column 7) by using
>
> :setlocal indentexpr=6
>
> To use it in all buffers, use
>
> :filetype indent off
> :set indentexpr=6
What I need is for it to be context sensitive. so if I have
if (foo == bar) {
// one fixed indent
if (bar == baz) {
//another fixed indent
}
}
--
Kim Schulz