9
3
In vim, if I enter and leave edit mode without doing anything, the caret ends up one character to the left. And if I enter and leave append mode, the caret moves forwards and then backwards.
Any way to configure vim to leave the caret alone in these cases?
Ideally I just want to always enter append mode, but without moving the caret when I enter or exit the mode.
(Currently I usually use insert mode because it doesn't mess up my caret position upon entry. That is, except when I need to append to the end of the line, in which case I swear at vim for behaving in such an archaic fashion, press Esc and enter append mode.)
1The answers to this question are good. I just want to point out that if they're correct in their assumptions that you use i to go to edit mode, then that's what's causing the moving backwards. If you use 'a' (not A) it will work as you expect. – johnny – 2011-01-07T09:12:31.193
@johnny I don't think it will. I'm usually in "normal" mode, moving around the file and stuff. When I need to make an edit, I position the caret first, then press "a", and then find that I had positioned it wrongly, because it moves to the right. Given that I spend 99% of my editing time in modern editors, there is no chance I will ever remember to position one char to the left before pressing "a". Which is why I was hoping for a macro or something. – RomanSt – 2011-01-07T11:47:16.450
It's a question of habits. It's indeed annoying, but the first years only. You'll eventually learn to press
i
ora
without think about it, and may be evens
,S
,ci"
, etc. instead of the limitedi
anda
. – Luc Hermitte – 2011-01-07T16:02:29.9671I understand your frustration but. Try instead to think about what you're doing. Ask yourself if there's a better way of doing it (than using Vim as a regular texteditor, that is). I've found with Vim there always is a better way, the Vim way of doing things. We can help but we have to know what you're doing when running into problems. Do you for example go into edit mode when you want to delete something? Don't, there's 'x' for deleting characters. Want to replace a character, then there's 'r'. Just think about what you want to achieve. – johnny – 2011-01-07T17:34:32.113
@johnny I understand what you're talking about, but it requires too much relearning to make sense for me. I spend 99% of my editing time in Visual Studio and I love it. I just know I won't relearn this, so no point wasting time. – RomanSt – 2011-01-08T02:40:27.210
Given that I spend 99% of my editing time in modern editors
I would use the termsGUI
orrecently created
. There is nothing out-dated about Vim, it is in continuous development.I spend 99% of my editing time in Visual Studio and I love it
. That's great if you'll only ever need to use that IDE on Windows, but Vim will give you a tool usable on *nix, Mac, over remote sessions, etc. To remain in VS while investing in your Vim-fu, try the VsVim extension – ljs.dev – 2013-10-23T17:21:10.047