Questions tagged [os-clipboard]

Questions about interfacing with the system's clipboard.

Filter by
Sorted by
Tagged with
1
vote
1answer
30 views

How do I yank the next 4000 chars, ignoring linebreaks?

I can for example, copy three lines to the clipboard with "+y3j. But I nothing happens when I attempt to yank 3 chars to the clipboard with "+y3l. Ultimately, I want to copy chunks more like ...
7
votes
1answer
356 views

How to prevent Vim from clearing the system clipboard (:reg +) on exit?

After copying text to the system keyboard clipboard in vim, I'm unable to paste the text after exiting vim. I find this behavior frustrating, since I often copy text in files to paste it on the ...
0
votes
0answers
23 views

how to copy text with mouse when nu and mouse=x is set in neovim

The only time the mouse does not select the numbers when mouse is set is if mouse is set to v. But you cant copy the text with right click or menu key.
0
votes
0answers
51 views

Online vim via browser, but with copy/cut/paste to/from Windows clipboard

I visited another city and forgot to bring my laptop. A friend offered to let me use his Windows 10 account, but without installing anything (including cygwin from a non-administrator account). It's ...
1
vote
1answer
40 views

How to copy contents of wl-clipboard into a Vim register?

I would like to swap content between my system clipboard and a Vim register. I am missing one last piece of the puzzle, indicated below. Any thoughts? map <Leader>" :call SwapBuffer()<CR&...
3
votes
1answer
72 views

Paste a column in a table

Suppose I have this file open in Vim: AXXK M(X) 1.1 1 1.2 8 And that the clipboard holds U(1X) MX1 MX2 How can I easily paste that content as a new column? I want: AXXK M(X) U(1X) 1.1 1 ...
1
vote
0answers
76 views

How to set copyq to handle clipboard

I want to let CopyQ clipboard manager handle clipboard (am using set clipboard+=unnamed setting). To that end, this setting was added to init.vim file: let g:clipboard = { \ 'name': '...
1
vote
1answer
93 views

Mapping <Shift>-Insert to paste in gVim search field

In gVim (not terminal Vim), I want to be able to paste from <Shift>-Insert (a.k.a. C-V) into the text input field of a search. I.e. when I press "/", and go into search mode, I want ...
5
votes
1answer
191 views

How do registers + and * interact with suspending Vim via Ctrl-Z?

As show in the following screencast, I see that using Ctrl-Z makes most recent written register of + and * overwrite the other one. You can see me doing the following: opening a file via vi -u NONE ...
0
votes
0answers
20 views

Creating vimrc kills my plugin

I have the following ~/.vim/filetype.vim: augroup filetypedetect au BufRead,BufNewFile *?Script.sml let maplocalleader = "h" | source /home/gergely/HOL/tools/vim/hol.vim " recognise ...
0
votes
1answer
52 views

What's the easiest way to replace some text with the contents of the clipboard when using clipboard=unnamed?

Assume I've copied some text into the clipboard from another program. I'm on MacOS, so in Vim terms, this means the text is in the + and * registers (I have verified this using :registers). I use ...
2
votes
2answers
119 views

Copy vim messages into clipboard

When I'm confronting a bug of a plugin and an error message pops up like this one: E5018: Error executing lua ... and if I want to report this bug, I always have to type this error message manually. ...
0
votes
1answer
165 views

Install Vim with +clipboard support but without Gvim?

My distribution comes with a minimal version of Vim. vim --vesrion returns -clipboard, so the * and + registers interact (copy/paste) with the primary and clipboard do not work. The resources I've ...
0
votes
1answer
30 views

How to completely disable os clipboard integration

The vim binary shipped with the git for windows package has integration with OS clipboard enabled and I hate it. So many times I attempt to replace a word with something from the clipboard with cw + ...
0
votes
1answer
974 views

How to install neovim with +clipboard extension?

I have NVIM v0.4.3 installed on Debian 10. When I run: :echo has('clipboard') I get 0, which means that this extension is not available. I cannot copy to OS clipboard using "+y and "*y ...
0
votes
1answer
26 views

How to copy the current value of a `set` option into the clipboard?

I sometimes need to copy the current value of a set option, e.g. set statusline, into the clipboard (+) to paste its value here. I know how to show the current value of a set option, e.g. set ...
2
votes
0answers
34 views

Vim `"+y` command to yank into registers `+` and `*` not working in vim-gtk3

The "+y , "*y, "+yy and "+d commands to copy to clipboard do not work for me. I want to copy text from vim and paste outside the text editor on my desktop. Things I have done : I ...
3
votes
1answer
189 views

Windows 10 Clipboard

Windows 10 has a clipboard history which can be accessed using WIN+V it has a recent history of all your copy and paste. When using this in VIM and trying to paste from it doesn't work it acts like ...
0
votes
1answer
170 views

How to copy text to clipboard in visual mode? [duplicate]

I ran the following sequence of commands: V10j ⌘ c but it seems like this doesn't copy the ten lines to my clipboard. So how can I do this?
0
votes
1answer
156 views

Inline paste from System Clipboard

I have recently started using Neovim on Windows 10. I use "+p to paste from the system clipboard. But sometimes I just want to paste inline before or after the cursor without adding a new line. ...
0
votes
3answers
78 views

How to copy the selection to clipboard without the indentation that is relevant just in the full file, not in the selection?

With other words: How to copy selection without its root-level indentation? Example: How to copy this: a b c d instead of: a b c d I am using Neovim inside VS Code ...
0
votes
1answer
55 views

clipboard not activated

I installed vim from their github repo. But I cannot seem to copy paste with from the system clipboard. So, I explored a little and tried to install vim-gtk package which would enable the clipboard ...
3
votes
2answers
188 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
1answer
244 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
0answers
51 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 ...
3
votes
0answers
367 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 ...
5
votes
4answers
772 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 ...
0
votes
2answers
58 views

no + or * register when entering vim from ranger

I'm running Ubuntu 18.04 with i3wm. Vim and vim-gtk3 packages are installed. If I'm in a regular terminal and I start editing a file in vim. I can yank text to the + register as expected. However, if ...
1
vote
2answers
135 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
253 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 ...
2
votes
1answer
343 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", @")&...
3
votes
1answer
456 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
138 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. ...
9
votes
2answers
980 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 ...
5
votes
0answers
48 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 ...
1
vote
2answers
248 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
0answers
120 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 ...
3
votes
1answer
362 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 ...
2
votes
2answers
3k 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 ...
7
votes
2answers
535 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 ...
1
vote
2answers
1k 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. ...
1
vote
1answer
52 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
0answers
60 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)?
1
vote
1answer
516 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 ...
0
votes
1answer
45 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 ...
1
vote
2answers
234 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
2answers
415 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?
0
votes
0answers
38 views

How to set system cut-buffer clipboard as default in vim? [duplicate]

I usually want to share my clipboard between vim and other applications (like a web browser) so that I can yank/paste the information easily. So questions, How do I set the default behavior of vim ...
0
votes
3answers
386 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?