Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In some moments vim works noticeably slowly

Tags:

vim

In some moments vim works noticeably slow. When I'm in normal mode in 100 line file, type "O" (uppercase letter o) it appears about 1-2 seconds and only then above of current line new empty line is created in insert mode (that is normal behavior). And I want to know possible reasons why this happens...

I have quite powerful computer, So the problem is not in computer.

like image 356
Zango Avatar asked Jan 31 '11 08:01

Zango


2 Answers

Are you hitting <Esc> then O in very rapid succession? If so, you are seeing the delay due to certain terminal escape sequences beginning with <Esc>O. Vim has to wait to see if you are actually typing one of those sequences.

To see this for yourself, in insert mode type <Esc>OA and your cursor should move up. Pressing <Ctrl-v><Up> in insert mode will show you the escape code generated.

like image 68
Randy Morris Avatar answered Sep 23 '22 15:09

Randy Morris


Type :map O

If you have a normal mapping starting with a capital O, it might be possible that Vim is waiting for a timeout to be sure that you are not starting to type a complex command.

Typically, the timeout default is of 1 second.

See :help timeout and :help timeoutlen.

If you do have a mapping starting with O, you can find where it is defined with :verbose map. You can then disable it or modify it (or remove the plugin defining the mapping).

like image 41
Xavier T. Avatar answered Sep 22 '22 15:09

Xavier T.