On Monday, April 2, 2012 8:26:14 PM UTC-5, Bovy, Stephen wrote:
> I guess observationally  it does not make much sense   
> 
> And actually I kind-of disagree      If   you  are on  X     You   switch to 
> Insert mode  ( then you insert some blanks ) 
> 
> When you switch out of insert mode you should still  be on  X  
> 
> The insert mode "caret" indicates where the insertion takes place not the 
> character the "cursor" is on (which has not changed)
> So when you switch out of insert mode the cursor should still be on the same 
> character  ( not the previous character) 
> 

This is not, and never has been, how Vim or vi works. Vim, like vi, has only 
one cursor position. The "caret" in insert mode is in fact this One and Only 
Cursor. Vim does not track two separate cursor locations, and in fact doing so 
would break expectations even more. If you're in insert mode and use the arrow 
keys to move the cursor up 357 lines, then leave insert mode, would you really 
expect Vim to jump 357 lines down to where you entered insert mode?

Regardless of how it should conceptually act, Vim and vi have ALWAYS acted the 
way they have now, with i<Esc>i<Esc>i<Esc> moving the cursor to the left. Doing 
otherwise would break many scripts and mappings which assume the cursor will 
always end up on the last character typed in insert mode (or it will move one 
character to the left from the point where insert mode was ended, in the 
general case where no text was inserted or the cursor was moved inside insert 
mode). In other words, changing i<Esc> to not move the cursor would be a major 
interface change. Changing Vim to track two separate cursor positions (one for 
insert mode and one for normal mode) would be an even bigger one.

If you really want to always jump back to the position at which you entered 
insert mode in a general case, you could try setting a mark in an InsertEnter 
autocmd and jumping back to the mark on InsertLeave. If you're having a problem 
with a specific mapping, tweaks to the mapping to use a different insert mode 
entry or avoid leaving insert mode altogether can probably fix it. If you just 
don't like that i<Esc> does something you don't expect, change your 
expectations or use a different insert mode entry command.

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui