If I try cc
or S
when the cursor (|
below) is in the following
position:
public function blah()
{
var i = 0;
|
i++
return i;
}
It stays in the first column instead of moving under the letter v
in var
. Pasting with ]p
also pastes starting from column 1.
My setup (in MacVim) is: autoindent
, smartindent
, nocindent
, and indentexpr=
, if that helps.
According to the following SO questions, correct indentation should be possible:
- Vim: Smart indent when entering insert mode on blank line?
- Vim: Indent current (blank) line and insert
- Autoindent in vim always empty the line if there are only whitespace in it, can I change that?
In the last post, @trVoldemort had the same issue (see the comments to the second answer).