I copied a part of the HTML out of a web page and wanted to save it in a file.
For that I started a new vim
session in a terminal window, with a (new) filename specified on the commandline, hit i to get to insert mode and then CtrlShift+V and waited while [-- INSERT --]
showed at the bottom and waited...
As vim
was non-responsive after several seconds, I opened 'Text Editor' from the Applications→Accessoiries menu pasted the text (which showed up within a fraction of a second, saved it under a new name, closed, and killed the Vim session that still was not done, 1.5 minutes later.
The amount of text was 186K in 3200 lines, not excessive I would say, nor with overly long lines.
Is there a way to speed up these kind of insertions in vim
and/or is there an explanation why this is so slow compared to using the, otherwise horrible and mouse oriented, Text Editor?
(The %CPU according to top
doesn't come above 5%, although I have some processors free in the system, so it might be some I/O bound problem, that doesn't exist when reading the same text from a file)
Version info:
Ubuntu 12.04
Vim: 7.3, with patches as supplied by Ubuntu 12.04
bash: 4.2.25
gnome-terminal: 3.4.1.1
vim
, do the pasting, and then re-enable it. Also try using the:set paste
feature to see if it improves things. See:help paste
it describes howvim
makes no distinction b/w typing and pasting.vi
to try to parse the file when reading in (after saving the way @l0b0 suggested), as well. But that works fast.:set paste
doesn't seem to really make a difference (I am not using a stopwatch, just the wall-clock).