DervishD wrote:
Hi all :)
This is not a bug report, it's just I'm curious about a behaviour
I've observed in vim, and I would like to know if this is the correct
behaviour or if some of my mappings may be causing the effect.
Let's say I have these two lines in a file:
this is one line
this is another line, longer
If I'm in insert mode and I put the cursor in the first line and
then I hit <End>, the cursor is placed after the "e" in "line". Then, if
I press <Down>, the cursor goes after the "r" in "longer" (I wanted to
put it on the "l" in "line", in the second line). If instead of <End> I
use <C-O>$, this doesn't happen, and in normal mode, it doesn't happen
even using <End>.
Is this normal? Is it caused by 'virtualedit'? I've observed this
behaviour in my own compiled version of Vim and in the packaged one in
Debian, at least, and I'm just curious.
Thanks!
Raúl Núñez de Arenas Coronado
It is normal and it has nothing to do with 'virtualedit'. If you place the
cursor intentionally "at the end" of a line, using <End> in Insert mode, <End>
or $ in Normal mode, etc., then moving the cursor up and down keeps it at the
end of the line. See at the end of the ":help up-down-motions" section:
<quote>
These commands move to the specified line. They stop when reaching the first
or the last line. The first two commands put the cursor in the same column
(if possible) as it was after the last command that changed the column,
except after the "$" command, then the cursor will be put on the last
character of the line.
</quote>
(<End> is synonymous with $).
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
82. AT&T names you Customer of the Month for the third consecutive time.