Questions tagged [os-clipboard]

Questions about interfacing with the system's clipboard.

Filter by
Sorted by
Tagged with
378
votes
12answers
385k views

How can I copy text to the system clipboard from Vim?

Is there a way to copy a block of text to the system clipboard, so I can paste it in another program?
19
votes
1answer
6k views

How do I get +clipboard support in Fedora 20?

It seems to me that neither "+p nor "*p works for me. How can I know if my Vim is installed and set up properly to make them available? And if it's not set up, what can I do to set it up? I'm running ...
13
votes
1answer
18k views

How do I use the system clipboard with Vim in Arch Linux? [duplicate]

I am using Vim on Arch Linux through urxvt. Since there is no "Ctrl-V" or "Ctrl-Shift-V" support in urxvt, there is no way for me to paste things I have copied from my browser (let's say) into my vim ...
12
votes
3answers
6k views

Vim on WSL: synchronize system clipboard? (set clipboard^=unnamed)?

While using WSL/Bash for Windows I want to be able to use y yy 3y and p the same way they always work in vim, but connecting to the system clipboard shared by all apps, not to vim's internal clipboard....
9
votes
2answers
640 views

Difference between “* and ”+ registers in +clipboard VIM?

"*p and "+p seem to behave the same. I tried :help "*, but it's talking about mouse selection, and :help "+ tells me There are three documented X selections: PRIMARY (which is expected to ...
9
votes
1answer
3k views

Copy the full path of current buffer to clipboard

Is there a quick way to copy the full path of current buffer to system clip board or some register? :put=expand('%:p') then use other copy commands(like dd) works but the typing is a little long.
9
votes
3answers
1k views

Paste link to image in clipboard when editing Markdown

I have an image on the clipboard and I want to paste it into my document as the text [](img/image1.png). Instead of first copying it to that directory, I want to do it with a single p key press in ...
9
votes
1answer
4k views

Define custom commands for the * and + registers

If I'm using a build of Vim with the xterm_clipboard feature then the system clipboard content is available through the + register. If the build I'm using doesn't have this feature, can I make the "+ ...
8
votes
6answers
6k views

How can I copy/paste new text without auto-indentation at every new line?

How I paste now: Right-click/Copy or simply highlight. Right-click/Paste or Middle Click or CTRL+SHFT+V Indents appear at increasing intervals: 0, 2, 4, 6, + Question at hand: From prior research, ...
7
votes
1answer
270 views

Can visual select mode be integrated with the Unix selection clipboard?

Is it possible to configure vim (obviously with :set mouse=a) and/or gvim such that the visual selection modes automatically integrate with X's selection buffer? I am aware of how to setup the copy ...
7
votes
1answer
2k views

What's the difference between the “clipboard” and “xterm_clipboard” features?

What is the difference between the clipboard and xterm_clipboard features? When do I need to enable one or the other at compilation time? As an aside, how do these features relate to the mouse ...
6
votes
2answers
7k views

How to select and copy lines to clipboard which are selected by mouse without linenumbers and gutter?

In my default Vim settings I've enabled a gutter and line numbers. Sometimes I copy some lines to clipboard in order to paste somewhere else. Currently I need to disable line numbers and the gutter. ...
6
votes
1answer
1k views

Copying From Vim to Ubuntu Bash on Windows

Note: this question is specific to the relatively new Ubuntu Bash on Windows system. So it seems possible to paste into Vim from the Windows clipboard by simply right clicking in insert mode after ...
6
votes
1answer
7k views

How can I copy over an ssh session without +clipboard?

On my local computer, I have the following in ~/.vimrc, which allows me use to the mouse (e.g. to select text) and to copy to the system clipboard with Ctrl+c. set mouse=a vnoremap <C-C> "+y ...
6
votes
1answer
877 views

Clipboard sharing broke under MacOS X

I'm using (roughly) the same config for my mac and my ubuntu machine. I use set clipboard=unnamed,unnamedplus To conveniently share vim's clipboard with the system clipboard. However, lately the ...
6
votes
0answers
83 views

Prevent gvim from clearing the clipboard on exit [duplicate]

If I copy text into the xterm clipboard ("+y) from gvim, it is cleared when I exit gvim. How do I prevent this? I've found the solution for vim, but it doesn't work for Gvim: autocmd VimLeave * ...
5
votes
1answer
887 views

Can Vim add to the X11 clipboard or primary buffers without an external utility?

We can copy to both the + and * registers, but this doesn't actually copy the content to X's memory (apparently). If you copy something from Vim using the * or + registers and quit Vim, poof! There's ...
5
votes
1answer
206 views

How to disable the clipboard being overwritten when highlighting text in visual block mode?

Say I've got a URL in the clipboard, I enter vim, I hit <C-Q> and highlight a word. Then I hit I<C-R>+ to insert the clipboard at the start of the selection. What actually happens is the ...
5
votes
1answer
4k views

Compiling vim from source just enabling clipboard

I have a Debian 7.0 with gnome, and I am fully satisfied with the standard vim version installed on it, except for the lack of +clipboard and/or +xterm_clipboard. I got the sources using mercurial, ...
4
votes
3answers
595 views

Is it possible to wrap characters around text every time you paste something from the system clipboard?

I am going to be pasting a lot of characters into a file. Each time I paste something, the pasted element will need to be wrapped in quotes and followed by a comma. Is there a way to automatically ...
4
votes
1answer
231 views

Vi: * and + registers do not exist

I'm unable to use the system clipboard in Vim. I'm using ssh to connect to an EC2 instance running Ubuntu 18.04. I'm fairly sure that this has to do with neither the * or the + register showing up in ...
4
votes
2answers
369 views

Install vim features

I have installed a tiny vim version without the clipboard feature. Can I load this feature for the current version or do I have to install another version of vim? $ vi --version VIM - Vi IMproved 7.4 ...
4
votes
0answers
19 views

How to copy text to X primary selection only when visual mode is started with the mouse?

At the moment, if I use Visual mode, whenever I select a block of text using the keyboard it ends up on my X primary selection (ie the clipboard that is filled using the mouse). Even if I just select ...
3
votes
4answers
146 views

Clipboard is reset after first paste in Visual Mode

I am on Neovim. This is really annoying and weird. When I make a selection in Visual Mode and copy, then select a text and then paste, this paste only works once. For the next time, I again have to ...
3
votes
1answer
2k views

Neovim Clipboard Selection

I am using neovim 0.2.3 dev and xfce4-clipman clipboard manager. I want to copy from the neovim into registers and put it into clipman register. How can I do that?
3
votes
1answer
2k views

Not able to copy from terminal when using vim from homebrew on macOS

When using the vim installed by default in macOS 10.12.5, I can copy text from the terminal by using cmd-C and pasting it into another applications. But when I use the latest version of vim (8.0....
3
votes
1answer
253 views

unable to copy to system clipboard with +clipboard and +xterm_clipboard in vimx

The system is Centos7.2. I have installed vim-enhanced and vim-X11, used vimx command. It shows that vimx supports clipboard and xterm_clipboard. But in vimx, there is no reg + and reg *. I can't ...
3
votes
1answer
4k views

Can't yank into * or + registers [duplicate]

I'm trying to yank to the system clipboard on Ubuntu 14.04. I can't yank into the + or * registers, though. Every time I visually select my text and type "*y or "+y the indicator on the bottom right ...
3
votes
0answers
223 views

Is there a content length limit on the selection and drop register "+?

When selecting about two dozens of lines in vim and copying it to the system register ("+ y), and then paste it into another vim, it crashes. It does not paste the content of the register and the ...
2
votes
2answers
2k views

Paste clipboard shortcut in vimrc

I know that I can paste the clipboard in by by typing ctrl-shift-v. The problem is that this is a very counterintuitive shortcut. It requires me to move my hand in a very uncomfortable way. I would ...
2
votes
1answer
146 views

copy-paste selection locally when editing files on remote headless server

When connected to a remote headless Linux server via SSH, I want to be able to do 3 things: select text using the mouse and copy the selection into my local X clipboard paste from local X clipboard ...
2
votes
1answer
44 views

Copying to unnamedplus doesn't work across instances

Whenever I copy with "+y it only works for the instance of vim I am running and I would expect it to write to my system clipboard, that I can access both outside of vim and from other vim instances. ...
2
votes
1answer
41 views

How do I enable copy/paste between vim and tmux in both two directions?

In a tmux session, I'm running vim in one pane and a terminal in another pane. Recently, I figured out how to enter visual mode in tmux but it doesn't help much now. Can I yank selected text from a ...
1
vote
2answers
62 views

Why does <F22> appear when pasting into Vim?

I want to paste some text into Vim in GNOME Terminal on Ubuntu 20.04. Before doing that, I run: :set paste I use that so that autoindent and other Vim features don't change the text that I am ...
1
vote
1answer
36 views

Can you run a regex on a register or the clipboard contents?

I want to copy something to a register or more ideally the system clipboard and then run a search / replace regex on it the way that I do in the buffer...is that possible?
1
vote
2answers
315 views

How to start gvim from command line with predefine pasting from clipboard

I know gvim -c [command] samaple.txt might run command predefined in command body. How to paste text from windows clipboard at the end of sample.txt file?
1
vote
1answer
63 views

Can't copy special characters outside of vim

I'm using NVIM v0.4.3 with set clipboard=unnamed. I can insert special character like üäö in vim just fine, but if I copy content containing special characters in vim and try to paste them outside of ...
1
vote
2answers
132 views

How can I edit the contents of my clipboard in vim?

Often while editing (say, a post on this network), I find myself wanting to copy something, edit it, and paste it back. At other times, I have some text in my clipboard, but isn't perfect. I would ...
1
vote
1answer
97 views

Any vim-plugin to access system clipboard on as many unix platforms as possible?

There are many question regarding this on SE and various solutions have been provided on how to access system clipboard on various platforms. I ssh to various machines and on some platforms, my ...
1
vote
1answer
322 views

How to merge OS'es clipboard with Vim's one? [duplicate]

How can I merge OS clipboard and Vim's one? I want them to be the same, so that I don't have to use "*y or "*p or "*d, instead just y, or p or d. How can I do that?
1
vote
1answer
53 views

Disable Shift+Insert from pasting from Primary

In Vim, the canonical methods to interact with X11's Clipboard and Primary is to use + and * registers. There are at least another two ways to paste from Primary into Vim: Shift-Insert and Mouse ...
1
vote
1answer
59 views

How to automatically perform a command after yanking text [Vim wayland clipboard]

I want to copy contents of the recently used " register automatically into my system clipboard after a yank command. The way I achieve this now is by nnoremap <C-@> :call system("wl-copy", @")&...
1
vote
1answer
370 views

Unable to use the clipboard when inside terminal (:term) on macOS

Actually, I am unable to do so when I am using MacVim Application. But inside iterm using Vim (the same MacVim release), I am able to. They also both use the same .vimrc . Both versions compiled ...
1
vote
2answers
175 views

Overwrite buffer with system clipboard by ex command

I'm trying to find the right ex command to overwrite the current vim buffer with the system clipboard. The relevant system clipboard register is "+ in this case. My first guess was to use :%+p; i.e. ...
1
vote
1answer
100 views

Why does this clipboard manipulation that works on Vim not work on GVIM?

In my .vimrc I have this piece of code: " Gist it to bl.ocks.org {{{ let g:gist_clip_command = 'xclip -selection clipboard' command! -range=% Blocks \ <line1>,<line2>Format format | f ...
1
vote
0answers
45 views

No + or * register on Linux (accessed via SSH from macOS)? [duplicate]

I am on Ubuntu 14.04.3 and Vim 8.2. I'm trying to figure out how to access either the * or + clipboard on Ubuntu but it seems like it doesn't exist? After doing "*yy and "+yy on lines of ...
1
vote
0answers
69 views

Vim adding blank line after each line when pasting from clipboard

When I copy-paste multiple lines from clipboard into my vim, it inserts a blank line after every line. But when I copy in into a text editor first and then copy-paste it into vim, the blank lines are ...
1
vote
0answers
75 views

Pasting non-text data (image) from system clipboard [closed]

I would like to write a plugin which will be triggered at paste from system clipboard if it contains image data. Is it feasible to do this with scripting? My preference is to write in Python, using ...
1
vote
0answers
50 views

Sharing a copy register between vim on different machines?

The image below shows two terminals. Both are running vim instances on remote machines (ssh and a serial connection through an UART cable). Vim's on those machines don't have a way to access the ...
1
vote
0answers
24 views

Copy/paste across terminals in nvim? [duplicate]

How do you copy/paste a piece of text across different terminals in nvim (neovim)?