Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM duplicates text I type

Tags:

vim

I have found that occasionally when I am hitting esc to enter back into normal mode with VIM after typing some text, the text I just typed will be duplicated 2 or more times.

I'd love to know what is causing this so I can avoid it.

Using VIM within iTerm2 on OSX 10.7.3 if that helps.

like image 964
Joshua Fricke Avatar asked Feb 16 '26 13:02

Joshua Fricke


1 Answers

That usually happens if you hit a number key (0-9) by accident before you went to insert mode. Try 9iAbEsc. That will give you

AbAbAbAbAbAbAbAbAb

But it's all correct: It tells vim to insert Ab 9 times. It's as with every vim command, if you place a number N before the command, vim repeats the action N times.

like image 121
Johannes Weiss Avatar answered Feb 19 '26 06:02

Johannes Weiss