[SOLVED] How to restore traditional X11 copy-paste when using vim?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to restore traditional X11 copy-paste when using vim?
I recently installed Slackware 14.2-64 and am using xfce4.
I'm running vim in an xfce4-terminal.
If I try to paste text into vim, while in insert mode, using middle-click (actually 2-finger tap), it seems to be the equivalent of doing ^V. Similarly, if I select text in vi
I can't then paste it to a terminal.
Is there a good explanation somewhere about X11 buffers, clipboards, left-click select/middle-click paste, ^X ^C ^V
etc?
I'd just like it to work the same way it did the last 25 years...
If I try to paste text into vim, while in insert mode, using middle-click (actually 2-finger tap), it seems to be the equivalent of doing ^V. Similarly, if I select text in vi
I can't then paste it to a terminal.
Try using Shift-Middle Click. To copy text from vim to another terminal I press Shift, select the text with the mouse, and then press Shift-Insert in the other terminal window to paste. Or you can select the text inside vim then press "*yy or "+yy to copy text to the system clipboard.
Quote:
Originally Posted by colinh2
Is there a good explanation somewhere about X11 buffers, clipboards, left-click select/middle-click paste, ^X ^C ^V
etc?
Read the vim help file with :help x11-selection first. There's also plenty of info out there. Here's two pages with more information:
I spent so much time turning unwanted vim features off that I actually decided to try emacs instead.
This is exactly what I have been doing, every vim release I need to increase the size of my ~/.vimrc to get back to 'sane' defaults. What really pushed me over the edge is when I had to add:
Quote:
set scrolloff=0
when vim set yet another new default, took me a while to find that one.
For the interested, these are the settings I have had to append to ~/.vimrc since the release of 7.x pastebin
Edit forgot: what I have for copy/paste while in gvim
X-buffer, copy/paste:
Quote:
map <F9> "*y
map <S-F9> "*P
Windows type, copy/paste:
Quote:
map <F10> "+y
map <S-F10> "+gP
John
Last edited by jmccue; 08-22-2017 at 06:35 PM.
Reason: edit: forgot to add what I do for copy/paste
I spent so much time turning unwanted vim features off that I actually decided to try emacs instead.
With emacs and evil you get the best of both worlds. With emacs you get org-mode, an insanely powerful RPN calculator, a built-in shell, a file browser, a web browser, and Tramp for remote editing; and with evil you get Vim's far superior modal editing and keys. Evil's vi(m) emulation is almost flawless.
Just fyi, you don't have to recompile vim. Pat kindly compiles vim twice (vim and vim-gvim packages). However, you don't have to use gvim's gui. It works just fine in the console (launch with -v). You then get x11 copy/paste without recompiling. I use this everyday with this in my bashrc:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.