Hi
I noticed that running a vim command such as...
:g/./d
... was slow with a large number of lines, whereas it used to
be reasonably fast. It e.g. takes ~7 seconds with "only"
5000 lines using:
$ yes | nl | head -5000 | vim - -c 'g/./d'
At first I thought it was a recent vim regression. But then
I recalled that I recently installed the clipman applet [1] in
my xfce4 desktop. I disabled that xfce4 applet and saw that
the :g/./d command in vim became faster (~ 2 sec).
I then realized that the Vim command :g/./d copies
each line that it deletes to the clipboard. And somehow
the clipman applet made copying to the clipboard slower.
In fact if I disable x11 in Vim using Vim -X, this command
becomes instantaneous:
$ yes | nl | head -5000 | vim -X - -c 'g/./d'
It's not really a vim bug, but I wonder whether we can
do something in Vim to make a command like :g/./d
faster. I don't really need this command to copy each
of the 5000 lines to the clipboard. Maybe it could be smart
enough to copy only the last line to the clipboard?
It may not work if we do CTRL-C though.
Or maybe there could be a new command modifier
`:keepclipboard {cmd}` which would run the command {cmd}
without touching the clipboard, in the same spirit as existing
commands like `:keepalt`, `:keepmarks`, `:keepjumps`,
`:keeppatterns`.
I would then be able to run`:keepclipboard g/./d` which would
presumably be much faster (instantaneous with only
~ 5000 lines).
FWIW, I use the clipman applet [1] in xfce4 for 2 reasons:
- store the history of N recently copied text
- and unify the 2 Linux clipboards: primary clipboard and
default clipboard, in a way that it is possible to paste
what is selected with the mouse. I always found
that having 2 clipboards to be more annoying than
useful and unifying them with clipman helps me.
[1] https://docs.xfce.org/panel-plugins/clipman/start
Regards
Dominique
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAON-T_iFuP1Dm%3DNKhAmkd1McMtBM%3DZLssLtZGivGqGWQxU%2ByiQ%40mail.gmail.com.