Benjamin Esham wrote:
Yakov Lerner wrote:
Laurent Birtz wrote:
When I press 'o', it starts an empty line correctly indented. If I press
'escape' immediately, the indentation is removed and the cursor moves to
column 1. If I press 'enter' instead, the indentation is removed for the
first line, but the subsequent lines remain indented when I finally
press 'escape'.
Correctly indented here for me, after o<Enter>.
Somewthing is wrnog either with eyour settings, or with vim version. You
didn't answer my question regarding your vim version (:version)
I get this behavior with 7.0.94, but it's done this for as long as I can
remember (I've been using Vim since 6.2, I think). I always just assumed
that it was standard (if annoying) behavior. Some relevant options set are
autoindent, ts=4, sw=4, noet, and bs=2.
And actually, if I press 'o' on an indented line, press Enter a bunch of
times, and then Esc, /none/ of the newly-created lines are indented.
--
Benjamin D. Esham
[EMAIL PROTECTED] | AIM: bdesham128 | Jabber: same as e-mail
β...when two opposite points of view are expressed with equal
intensity, the truth does not necessarily lie exactly halfway
between them. It is possible for one side to be simply wrong.β
β Richard Dawkins
Indentation is a moot point on an empty line.
If I hit "o" (in Normal mode) on an indented line, or <Enter> after it,
then <Enter> a bunch of times, and then type some text, it will be
indented like the original line. The blank lines in between will be
truly empty, not filled with enough spaces and/or tabs to make them as
long as the indent, which is proper behaviour IMHO (I hate editors which
leave a bunch of useless spaces or tabs at the end of lines).
If I hit <Enter> at the end of an indented line, then <Enter> a bunch of
times, then hit the space bar, the Backspace key, and _then_ the Esc
key, the last line keeps its indenting spaces and/or tabs. The blank
lines before it are empty. The cursor goes back to column 1, but hitting
A on this last line restores the cursor to after the indent, where text
can be typed. (Hitting <Esc> immediately after the last <Enter> without
<Space><BS> loses the indent.)
I'm using Vim 7.0.97, huge version with GTK2/Gnome GUI, on SuSE Linux
9.3 with X11 and kde; and I have (among others) the following settings:
:filetype plugin on
:filetype indent off
:set autoindent smartindent nocindent indentexpr=
:set list listchars=tab:\ \ ,eol:ΒΆ,nbsp:~
" the latter two are helpful to spot end-of-line spaces or tabs
Best regards,
Tony.