Laurent Birtz wrote:
Hello,
I need help to change the default behavior of the 'autoindent' option.
The doc says:
Copy indent from current line when starting a new line (typing <CR>
in Insert mode or when using the "o" or "O" command). If you do not
type anything on the new line except <BS> or CTRL-D and then type
<Esc> or <CR>, the indent is deleted again.
I *do not* want vim to remove the tabs when empty lines are inserted by
typing
'escape' or 'return'. It's a pain afterwards to bring the cursor back to
the
correct indentation level (both with vim and other editors). Is there
any way
of doing this aside of hacking the sources? I do not use 'cindent' or
'smartindent' options.
Thanks a lot,
Laurent Birtz
I don't think there is a straightforward way. What you could do is start
the first nonempty indented line, and then (once it _is_ nonempty) add
the empty line(s) above it. "Write the code first, beautify afterwards".
To add an empty line above the current line in Insert mode you can use
Ctrl-O O (control-oh followed by shift-oh).
Best regards,
Tony.