On Thu, Sep 08, 2011 at 05:42:51PM +0200, Romeo Van Snick wrote: > This seems to work as expected, yet there is one problem: imagine I do > the following sequence of key presses when in normal mode > i <esc> i <esc> i <esc> > one would expect that the one is now in normal mode, and the cursor is > still at the same character it was before. Yet it isn't: it has moved > three characters to the left (as if I had pressed hhh).
Actually, one wouldn't expect that once one understands where the cursor is positioned in normal mode vs. insert mode. > The reason for this is when the InsertEnter auto command triggers, > there is also a cursor movement to the left (h), without me wanting > this. This is standard Vim behavior and has nothing to do with your autocmd. If you want the cursor to stay put while you enter/leave insert mode without doing anything else, you need to use a<Esc>. There's some more explanation and, if you still want to change it, some ideas of how to work around it on the wiki[0]. [0]: http://vim.wikia.com/wiki/Prevent_escape_from_moving_the_cursor_one_character_to_the_left -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <james...@jamessan.com>
signature.asc
Description: Digital signature