Linux shared with Windows clipboard (clipboard)

Source: Internet
Author: User

How Linux shares the Clipboard (clipboard) with Windows

First say two nonsense, in fact, Linux and Windows do not need to share the Clipboard, directly in the putty, press and hold the shift+ mouse to select it.

However, this method is required as a hack behavior or as a copy function without a mouse.

Combination:

Putty+tmux+vim+mobaiterm/xserver

If the familiar friends should have been accustomed to the previous three software, known as The Three Musketeers.

The next two software uses only a subset of these features, the Clipboard for X window.

Xserver refers to the windows side of the display, the client is the Linux side of the program to send image data to the server, request to display its window xserver here, rather than in its original window display.

Configuration:

Putty

Configure as shown, open enable x11forwarding, and fill in the value of the X display location: 127.0.0.1:0

Here the 127.0.0.1 refers to the Xserver IP address,: 0 refers to the display window, in the X Window concept, multi-user system, so you can display a number of different windows, 0 is generally the default window.

If you are using Cygwin or some other ssh-agent connection, you can add ssh-x [email protected]_ip_address way to add X11forwarding method.

Figure 1

Tmux

In the Tmux configuration file. tmux.conf, add the following code:

#Copy tmux Paste buffer to CLIPBOARD (CLIPBOARD selection Integration) #must install Xclip and xselbind c-c run "Tmux save-b Uffer-| Xclip-i-selection Clipboard "#Copy clipboard to Tmux paste buffer and paste Tmux paste bufferbind c-v Run" Tmux Set-buffe R--\ "$ (xclip-o-selection clipboard) \"; Tmux Paste-buffer "

It means that when Ctrl+a,ctrl+c is executed, the buffer in Tmux is added to the clipboard of the Linux system, and Ctrl+a,ctrl+v is the clipboard content of the output Linux system.

Vim:

In Vim, add

Set Guioptions+=aa "Get some autoselect interaction with the system Clipboard

This is applied in the Vim GUI, and the vim in the command line is invalid.

Mobaiterm/xserver

Here, Mobaiterm and Xserver in the xming is a function, is they provide, the Linux clipboard into the Windows system Clipboard, this is just a small function, in fact Xserver can do a lot of other things, I tried, is a special concept.

Use:

What is needed now is to copy a portion of the document with Tmux, ctrl+[into the selected state, and then press the space <space>, using VIM to move the cursor up or down, select the text, use <Enter> Copy to Tmux, and press CTRL TMUX. +a,ctrl+c copied to the Clipboard in the system Clipboard, and then pasted in the editor under Windows, you can paste it into the text you just tmux selected.

If you want to put the copied content in Vim into Windows, use "+y" to put the content on the system's clipboard and then copy it to Windows.

Reference (extended reading):

How to copy from Tmux running on Putty to Windows clipbard:http://stackoverflow.com/questions/17255031/how-to-copy-from- Tmux-running-in-putty-to-windows-clipbard

Linux shared with Windows clipboard (clipboard)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.