I have been using VI and VIM for years (30 or more) (in xterms, not its own window, gvim) and I have a huge library of vim commands that I give vim using the mouse middle button as a selection.
For example I would often do things like...
vi {many_hundreds_of_files}
paste vim commands using mouse - one paste per file.
The selection would include lots of VIM commands to do things things like replacing test, formatting, move lines around, etc., etc., etc., and typically ends with :w and :next VIM commands, at the end of the selection, so vim is ready for me to paste again into the next file. This lets me update huge numbers of files in VERY complex ways, without needing special scripts (such as perl in-place editing) to do it.
Some of these vim command pastes are 200+ lines long (stored in text files I pop-up on screen, and 'copy-all'! These make a LOT of changes to the set of thousands of files I am re-formatting. But only for the specific set of files, not for my day-to-day vim work. EG: Bulk re-formating for text/data files.
The Problem...
During my last system patch (Fedora 25) vim now pastes the mouse selection AS TEXT and not as vim commands, and I can't seem to stop it!
It still works fine on another system (Fedora 24).
If I want to paste as text, I enter insert mode before pasting! I don't want VIM automatically pasting selections AS text when it is not in insert mode. I understand this was meant as a security feature, but to me it is a MAJOR usability issue.
I have tried back dating terminfo entries (xterm-256color) from a machine that does not do this (especially the "kmous" terminfo entry). I have also looked at the vim ":set mouse=" setting (which is null!). I do not know if it is the xterm (doubtful), or something that changed in VIM (likely), and change logs and google have been unhelpful.
Nothing however seems to get me the old behaviour.
vim
change: How canvim
inside anxterm
know something is entered through keyboard or pasted through mouse button? I don't know such a mechanism. On the other hand,xterm
knows that it's executingvim
so it could decide to surround the pasting withi
and <esc>. Try (a) with a different kind of terminal window and (b) a copy ofvim
with a different name. This should help to narrow the cause of the problem.vim
is hijacking your paste method. Maybe try ssh'ing or telneting into your machine and pasting that way. If you have a Windows box, use putty to ssh into your Fedora25 machine and paste that way.gvim.exe
(graphical-vim) and command-linevim.exe
. Paste "itext" in gvim.exe and you getitext
. Paste it in the vim.exe and you gettext
pastetoggle
option?