Saturday, May 22, 2010

Re: backspaces leaving Insert mode

Hi,

On May 21, 5:48 pm, "John Beckett" <johnb.beck...@gmail.com> wrote:
> NickC wrote:
> > I've put up with this for years.  Whenever I leave Insert
> > mode by typing the Esc key, the cursor backtracks one char.
> > I almost always have to right-arrow, so I would like to
> > change the behaviour so that the cursor stays where it is.
[...]
>
> This is "by design" and won't be fixed. Sometimes people suggest
> getting into the habit of pressing a (append) instead of i
> (insert). Pressing Esc then gives no surprise.

I also find this behavior a pain. It causes me to extra work - more
than just having to press 'a' instead of 'i'.

For example, when I'm using Vim to draft prose, I'll often use
indentation to organise the structure of the text. So different
paragraphs are at different levels of indentation. And then I might
take a paragraph I've written and break it into a number of double-
spaced lines so I can more easily see the paragaph's
internal structure.

So if the above paragraph was indented like this

For example, when I'm using Vim to draft prose, I'll often use
indentation to organise the structure of the text. So different
paragraphs are at different levels of indentation. And then I
might take a paragraph I've written and break it into a
number of double-spaced lines so I can more easily see the
paragraph's internal structure.

So I might break up like this:

For example, when I'm using Vim to draft prose,

I'll often use indentation to organise the structure of the
text.

So different paragraphs are at different levels of indentation.

And then I might take a paragraph I've written and

break it into a number of double-spaced lines so I can

more easily see the paragraph's internal structure.

Exactly where I break things up depends on the structure of the
sentence, so I have to break it up manually. Often I'll insert line
breaks after commas or at the ends of sentences. So in the latter case
I'd use ')' to jump to the next sentence, press 'i' then insert two
carriage-returns, then press <ESC>.

Say then the next break I want to put in is at the end of the sentence
I've just moved to the start of its own line. If <ESC> left the
cursor where it was, the cursor would be at the start of the sentence
and I could just press ')' to go to the ned. But since <ESC> moves
the cursor back one, I have to press ')' once to get to the start of
the sentence I was just at, and then again to move to the next
sentence (or I could of course type '2)' but either way it's extra
work).

The problem I'm describing tends to occur when you insert some
characters before some pre-existing text and then want to move
forwards in some chunk - such in the aforementioned case of using ')'
but also with things like 'w'.

Hopefully I've convinced you that the behavior of <ESC> moving the
cursor back one position can create needless extra work. I can't see
any benefit to making <ESC> move the cursor back one like it does (not
saying there isn't, but it's not apparent to me) so I'm wondering why
it does that "by design", as mentioned above?

At least it would be nice if Vim had an option for controlling how
<ESC> effected the cursor position. i.e. if you could do something
like

:set noEscMovesCursor

Regards,
James.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment