Questions tagged [os-clipboard]

Questions about interfacing with the system's clipboard.

Filter by
Sorted by
Tagged with
286
votes
9answers
235k 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?
17
votes
1answer
5k 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 ...
11
votes
1answer
13k 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 ...
10
votes
3answers
3k 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
1answer
2k 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 "+ ...
7
votes
6answers
5k 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
3answers
565 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 ...
7
votes
1answer
1k 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.
7
votes
1answer
248 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 ...
6
votes
1answer
705 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
76 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
774 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
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 ...
5
votes
1answer
180 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
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 ...
5
votes
1answer
3k 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
572 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
2answers
5k 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. ...
4
votes
2answers
228 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 ...
3
votes
1answer
1k 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
4k 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 ...
3
votes
1answer
103 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 ...
3
votes
1answer
3k 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
211 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
1k 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
1k 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....
1
vote
2answers
246 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
75 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
2answers
34 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
199 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
111 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
99 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
29 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
48 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 ...
1
vote
0answers
42 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
22 views

Copy/paste across terminals in nvim? [duplicate]

How do you copy/paste a piece of text across different terminals in nvim (neovim)?
1
vote
0answers
28 views

Make yanking pipe into an external program [duplicate]

Is it possible to set up an external program as my clipboard? I'd like vim to pipe into it whenever I yank something.
1
vote
0answers
640 views

Unable to copy to system clipboard

I'm running vim on a Debian Jessie machine inside of a VirtualBox on my Mac. I'm trying to get yy and p to work so I can copy and paste across different terminal windows by using the system clipboard. ...
0
votes
3answers
238 views

How to transfer a register to the system clipboard?

If I store a value in a register in vim, is there a way I can transfer it to the system clipboard using a quick ex command? Or do I need to write a macro to do that?
0
votes
1answer
177 views

How do you paste what is in your highlight clipboard?

I want to map vv to paste my highlighted text clipboard as opposed to vim's clipboard or the copy clipboard. Is this possible?
0
votes
1answer
39 views

Why aren't the lines copied into my system register?

My copy of Vim has the +clipboard feature compiled in: vim --version | grep clipboard +clipboard +job +path_extra +user_commands +eval +mouse_dec +statusline ...
0
votes
2answers
65 views

Explanation of command :'<, '>

(I'm really not sure how I would google this. Sorry if this has already been asked and please just link me in the right direction in that case) I'm using Vim in cygwin environment and marked a line ...
0
votes
1answer
21 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?
0
votes
1answer
136 views

How can I get more features?

My vim version is "huge" without GUI. Nevertheless, it is missing a lot of features like clipboard and python. How can I get a more full-featured version? I read that there is a version vim-nox which ...
0
votes
2answers
570 views

Vim is polluting clipboard with netrw_dirhist stuff

Every time I launch vim I have this in clipboard: let g:netrw_dirhistmax =10 let g:netrw_dirhist_cnt =8 let g:netrw_dirhist_1=... let g:netrw_dirhist_2=... let g:netrw_dirhist_3=... let g:...
0
votes
2answers
276 views

Make vim support the Windows clipboard

I've found a lot of information online about this for Linux-Vim but not for the Windows-Vim (not gvim). Whenever I try to copy and paste something in Vim (using y and p), the copies I make do not ...
0
votes
1answer
473 views

Highlight word on double click and copy to clipboard

I am using this excellent solution by Peter Rinker to highlight all occurrences of a word on double clicking. nnoremap <silent> <2-LeftMouse> :let @/='\V\<'.escape(expand('<cword>...
0
votes
1answer
86 views

What is clipbrdDefaultReg

Taken from here: https://stackoverflow.com/a/171558 What does let g:clipbrdDefaultReg = '+' mean?
0
votes
1answer
223 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?
0
votes
2answers
178 views

how could I enable vim clipboard with sudo and x11 installed

I am given an account on a new server these days. The new server does not have x11 install, neither do I have sudo. So I cannot install system packages, and I cannot compile with the option -with-x. ...