I downloaded Ubuntu in the Win 10 app store, installed vim, vim-gnome, opened + clipboard and + xterm_clipboard while viewing vim
But I vim: reg when there is no + or * clipboard, it can not be copied to the system clipboard
31 Answer
Problem Description: I downloaded Ubuntu in the Win 10 App Store, installed vim, vim-gnome, opened the + clipboard and + xterm_clipboard while browsing vim
But I vim: reg when there is no + clipboard or * clipboard, it can not be copied to the system clipboard
The cause of the problem: Ubuntu downloaded from the Win 10 App Store is without a GUI and needs to be installed with VcXarv
Solution: For those who want to go the X server route, let me leave my notes here.
- Install VcXsrv (I found that Xing is outdated on sourceforge and the new version is donationware)
- If it starts after installing, stop it
- Start it using XLaunch (search in the start menu), go with all the defaults (ensure the clipboard options are checked)
- At the end, save the configuration to a file (use that to start it from now on) Put export DISPLAY = localhost: 0.0 in your .bashrc in bash for Windows (and run the command in any open bash windows). The reason I said say localhost is that this makes SSH X forwarding work, see below.
- Ensure vim is installed using clipboard support. Vim --version | grep clipboard should say + clipboard, not -clipboard. Also if you run the ex command: echo has ('clipboard') in vim and it says 0 it does not have clipboard support compiled in. If you do not have clipboard support, install the vim-gtk package (apt-get install vim-gtk).
- It should now work
- As a bonus you should now be able to copy from and to your Windows clipboard from a remote machine by using SSH X forwarding (ssh -X ...). You can use xclip on the remote machine or if you use vim there you will again need to make sure the clipboard option is compiled into vim (eg install vim-gtk). You can probably also configure PuTTY to use your local X server in case you prefer using that for remote connections.
(The solution comes from robbiev's comment, this is the link: )