Changing modes shouldn't move the text cursor IMO. Any setting to disable this?
3 Answers
imap <silent> <Esc> <C-O>:stopinsert<CR>
Seems to work just fine :)
Also, set virtualedit=onemore needs to be set for best behavior.
I know this question is old but i figure a few people might enjoy this.
- 1,964
- 15
- 20
-
This works but i stopped using it because the mode text didn't change back immediately when exiting insert mode. – ggustafsson Feb 16 '12 at 11:07
The cursor doesn't actually move. In command mode (what you refer to as escape mode) it is on the 3rd (for example) character, while when you go to insert mode, it is behind 3rd character.
It is only true it will move if while in insert mode, you go into replace mode (press "insert" button on your keyboard) :: then it will move to the right character of your current position (in this case, the 4th character).
- 23,617
- 32
- 128
- 213
-
There are several ways of going into I mode, from N mode (command mode, or normal mode). One is pressing "a" - appends text after the cursor, the other is "i" - before the cursor. I actually didn't understand what you were talking about at first, because I usually more often press "a" ... – Rook Dec 30 '09 at 21:39
-
The cursor does seem to move left one space when going back into command mode. If you continue to type i, esc, i, esc, ... you'll see the cursor slide left. I do like the suggestion of using append (via "a") which moves it over to the right one space. Thanks. – AlexD Jan 01 '10 at 20:36
-
I have been using vi, vim, and now gvim for over a decade, and I never noticed the shifting. I use i to insert and a to append, and my typing goes where I want. This may be a minor interface quirk that you will simply stop noticing after a short time.
You may prefer the settings recommended here:
How to make cut/copy/paste in GVim on Ubuntu work with Ctrl+X,Ctrl+C,Ctrl+V?
I know I do. These settings don't really address your issue, but if your vim/gvim experience is more familiar, you may not care so much about character shifting behavior.
One additional alternative: You might try the cream settings (http://cream.sourceforge.net/features.html). If you are using Ubuntu or Debian, there is a package you can install with apt-get/aptitude/synaptic (the package is named cream).
- 3,711
- 3
- 31
- 30