Gary Johnson schrieb:
On 2007-04-16, fREW <[EMAIL PROTECTED]> wrote:
 On 4/16/07, Tom Whittock <[EMAIL PROTECTED]> wrote:
What I need is to always keep the auto-indented spaces.  So next time
I can start to insert from the spaced cursor.
Alternatively use cc to edit the ostensibly blank line. This will open
the line using the correct auto indent. Get into this habit and it
doesn't matter what state the line was in before - you always get the
right indentation.

Cheers.

 I tried cc and S and neither of them correctly reindented the line for
 me.  What gives?

It may depend on the indentation mechanism being used. That is, on whether you're using 'autoindent', 'cindent', 'indentexpr' or something else. For example, it works fine when I edit C code (with 'cindent' set) but not in this e-mail (with only 'autoindent' set). If I indent this paragraph, then try to add a line below the last line by typing S or cc on that empty line, the new line starts in column 1. I don't know why that is.

Regards,
Gary

   :h 'ai
| Copy indent from current line when starting a new line (typing <CR> in
| Insert mode or when using the "o" or "O" command).

cc uses the indent of the current line.  Thus if it is empty there is no
indent.  Try using
   :setl inde=indent(v:lnum-1)

--
Regards,
Andy

EOM

Reply via email to