How to copy and paste things between vim and system clipboard
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I use 'gpm' and when you select then highlight with the left mouse button you can then pick a point in the same or other application with input mode. You can then insert with the right mouse button. This works in 'vi/elvis' since that's what I use. It will work between M$ and Linux since it is buffered.
I've tried set mouse=r and comment mouse settings in /usr/share/vim/vimrc but they don't work. ;(
It seems that it's very hard to send things to clipboard without +xterm_clipboard. But "SHIFT-middleclick" will paste in the input mode and paste words after 'i' or 'c' in the normal mode. It seems "SHIFT-middleclick" just throw strings into the terminal. Maybe we can do the copy in that way?
Yes, Gvim is xterm_clipboard enabled and hornor "+y. But I perfer launch vim while navigating in Konsole and hate the bad appearance of Gvim in a KDE environment.
I see that Vim 7.2 is out. Maybe PatV is preparing an other update?
The version of vim that comes with Slackware is compiled without x support. This is to accomodate users who don't run X. Unfortunately, this also means that if you do run X, you can't paste into vim from other X apps. Solve this problem by recompiling vim for X support (pass --with-x to its configure script). This is best done by downloading the entire vim source directory from a Slackware mirror, then editing and running the SlackBuild. After you do so, you'll be able to run the console version of vim inside an xterm, and paste text into it from other X applications.
Yes, copy and paste from X apps and the reverse works here too
My ~/.vimrc looks like:
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
" Only do this part when compiled with support for autocommands
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
map Q gq
if &t_Co > 2 || has("gui_running")
This is mighty funny to me, because I can paste into ViM from konsole
or from X apps using the middle button. What am I missing, or rather,
what have I got that you are missing?
I can paste into ViM opened from the KDE menu, or into "vim file" from
konsole, or into vim opened in xterm to and from anywhere.
I forgot to mention that I'm using KDE4.1 testing package from slackware.com. But I think it maybe does not metter. On my box, middle click does not paste the words selected outside but same other words which I don't know where they come from. But Shift+middle click dose the work.
Besides, it's also unconvenience if I can only paste things in but cannot get things out.