On 06/03/2010 12:48 AM, James Cole wrote: > Hi, > >> When in insert mode, cursor is between two chars. When in command mode, >> cursor is on top of a char, to make it possible to perform char >> operations. When you press escape, cursor either has to move back one >> char or forward one char. It can't stay in the place because it's in the >> middle and that makes no sense in command mode. > > Thanks for the explanation, I wasn't aware of that. > >> If you were at the end of >> line, obviously cursor would not be able to move ahead one char which >> means behaviour would be inconsistent. > > True, but I don't think that'd be a problem. At the end of the line > it could move the cursor back one instead of forwards. Vim's current > behavior is actually just as 'inconsistent'. It always moves the > cursor back one when returning to normal mode... except when the > cursor is at the start of a line, in which case it instead moves it > forwards one.
That's of course true, but in normal usage I would say you're about 50 times more likely to hit escape at the end of line rather than at the start (unless you prefer to type your text backwards). Inconsistency is a concern here mostly not because it would look or feel strange, but for things like mappings, macros, etc. In fact I remember there was a very long protracted argument about this on #vim irc channel and there were some really great arguments made for why going back is less inconsistent, I think it involved newlines and empty lines but I don't remember exactly now. > > Personally I feel that moving the cursor forwards when returning to > normal mode would be a more useful default. I think that after the > user has finished inserting some text the next thing they will want to > do is more likely to be concerning text located *after* what they've > just inserted (and thus less likely that they will want to do things > concerning the last character they've entered or ones prior to that). I don't think that's true, the only time I run into this is when I want to enclose something in a new function call: int(something) => int(round(something)) I have a mapping for enclosing in brackets and then entering insert mode, so when I remember to use that, I do brackets first and then add the function call. The issue here is that when going backwards is what you need, you don't notice it, but when you want to go forward, you do notice. Do the mapping to <esc>l and I think you'll find it's not always what you need, either. -ak -- 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
