Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Vim duplicating my text when I exit insert mode?

Tags:

vim

I'm using Vim in the zsh shell on OSX.

my-image-of-my-terminal

In the image you can see that I have created a test text on the left side. When I exit insert mode (using Esc), Vim duplicates my text a few times.

You can see my Vim editor when I exited the insert mode on the right side of the image.

Why does Vim do that and how can I prevent it?

like image 932
Inuitsegler Avatar asked Oct 22 '25 04:10

Inuitsegler


1 Answers

Make sure you don't accidentally type a number before entering insert mode.

Like any other action, entering text in insert mode can be repeated by prepending the command with typing a number.

For example, typing 3ihelloEsc from normal mode results in the text hellohellohello entered.

If you're unsure whether you have already typed a number, you can cancel any repetition by typing Esc again before entering insert mode.

like image 199
mkrieger1 Avatar answered Oct 24 '25 17:10

mkrieger1