Re: cursor moves back with ESC
On Oct 16, 2006, at 4:33 PM, Peter Hodge wrote: You can also try: inoremap l which will work a little quicker in a terminal Vim. works great, thanks! -lev
Re: cursor moves back with ESC
--- Yakov Lerner <[EMAIL PROTECTED]> wrote: > On 10/16/06, Lev Lvovsky <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I've never actually figured out why upon after typing in insert mode, > > the cursor moves back one character to the left after pressing > > escape. What's the reason behind this, and is there any way to turn > > it off? > > IIRC there was a post some months a go on list with > location of unofficial patch that changes this behaviour. > (I dont have the location of the patch at hand). > > You can try this: > au InsertLeave * norm l > , not that I find it convenient. YMMV. You can also try: inoremap l which will work a little quicker in a terminal Vim. cheers, Peter On Yahoo!7 Fuel Price Watch: Find the cheapest petrol in your area http://au.maps.yahoo.com/fuelwatch/
Re: cursor moves back with ESC
Lev Lvovsky wrote: On Oct 16, 2006, at 10:31 AM, Charles E Campbell Jr wrote: Seems a reasonable choice, to me. Any choice would be arbitrary. Now, to turn it off: don't use insert. Use append. if you mean 'a' as opposed to 'i' for the modes, it still does the same thing in my version. thanks, -lev When you hit 'a' in Normal mode, the cursor moves one character right while going into Insert mode, so that compensates for the leftwards move which happens on in Insert mode. In Normal mode, the cursor must lie on a character (assuming you're not using 'virtualedit'). In Insert mode, the cursor can be either on a character, or just after the last character on a line (in gvim, the Insert-mode cursor is normally a thin vertical line along the left side of its character cell, but it must still be regarded as being "on" a character cell). So there are one more possible cursor positions on each line in Insert mode than in Normal mode. The choice which (IIUC) the authors of Vi (ancestor to Vim) originally made, was to have the cursor move back by one character when going from Insert to Normal, except when at the left margin. The alternative would have been to have the cursor stay put, except when at the end of the line. I suppose either choice had arguments in its favour, but we're stuck with the choice that was made. Once you're accustomed to it, it stops chafing. One argument in favour of the choice that was made, is that when typing in new text you're usually at the end of the line (pushing the end of the line with the text you're adding), so it would have been awkward to have that be the exception. Best regards, Tony.
Re: cursor moves back with ESC
On Oct 16, 2006, at 10:31 AM, Charles E Campbell Jr wrote: Seems a reasonable choice, to me. Any choice would be arbitrary. Now, to turn it off: don't use insert. Use append. if you mean 'a' as opposed to 'i' for the modes, it still does the same thing in my version. thanks, -lev
Re: cursor moves back with ESC
On 10/16/06, Lev Lvovsky <[EMAIL PROTECTED]> wrote: Hello, I've never actually figured out why upon after typing in insert mode, the cursor moves back one character to the left after pressing escape. What's the reason behind this, and is there any way to turn it off? IIRC there was a post some months a go on list with location of unofficial patch that changes this behaviour. (I dont have the location of the patch at hand). You can try this: au InsertLeave * norm l , not that I find it convenient. YMMV. Yakov
Re: cursor moves back with ESC
Lev Lvovsky wrote: I've never actually figured out why upon after typing in insert mode, the cursor moves back one character to the left after pressing escape. What's the reason behind this, and is there any way to turn it off? To best understand this, one needs to use console vim. There, the cursor cannot be between characters; it must lie on a character. So, the insert puts a character before the character the cursor is on; when done, the cursor lies on the last inserted character. Now, try gvim. Gvim lets the cursor lie between characters, but when done, the character again lies on the last inserted character. Seems a reasonable choice, to me. Any choice would be arbitrary. Now, to turn it off: don't use insert. Use append. Regards, Chip Campbell
cursor moves back with ESC
Hello, I've never actually figured out why upon after typing in insert mode, the cursor moves back one character to the left after pressing escape. What's the reason behind this, and is there any way to turn it off? thanks! -lev