Questions tagged [os-clipboard]

Questions about interfacing with the system's clipboard.

Filter by
Sorted by
Tagged with
1 vote
3 answers
123 views

Exclude empty lines when copying

I'm writing Python programs using Vim/NeoVim. One thing I often do is copying text to the system clipboard using "+y command. This lets me copy parts of the program to the clipboard, and run it ...
RogUE's user avatar
  • 111
0 votes
1 answer
42 views

Change the clipboard register's name

To use Neovim with my system clipboard I have to use the + register which I find inconvenient. When I type something like "+p I have to bounce my pinky all around. Is there a way to change the ...
fin444's user avatar
  • 103
0 votes
0 answers
86 views

Yank to host clipboard when using nvim from Docker (WIndows)

NVIM v0.9.1 Windows10 I'm using neovim in Docker Desktop. Usually, when I use nvim in WSL2, I can yank / paste via "+y / "+p. But if neovim in Docker Desktop doesn't support the same ...
keisuke murota's user avatar
0 votes
1 answer
313 views

Pasting from system clipboard adds an unwanted new line

On windows, using neovim, with clipboard=unnamedplus , when I paste from the system clipboard using p or :put , it will always paste in a newline , even if the content of the clipboard has no newline. ...
icesentry's user avatar
0 votes
0 answers
171 views

Copy to android system clipboard in nvim from termux

I use Neovim on termux on android 11 I commonly use :y to yank/copy text to nvim clipboard Then paste it to another files Recently I've tried using helix-editor(hx) looks and feels so similar to ...
ANDuser's user avatar
1 vote
1 answer
63 views

Syncing x clipboard with yanks and put only?

I have discovered the joy of having :set clipboard^=unnamedplus. One issue I often face however is having whatever was last copied or yanked be overwritten by what I just deleted. I don't think ...
dvqc's user avatar
  • 13
0 votes
1 answer
327 views

Prevent neovim from overwriting system clipboard while cutting, copying or deleting text

As the title says, I want to disable neovim from overwriting existing content of my clipboard. I am using elementary os 7 horus and nvim v0.10.0-dev-115+g240c41e1a downloaded from github release page. ...
Abid Hasan's user avatar
0 votes
1 answer
295 views

How can I make NeoVim's clipboard work on my linux servers (like nano)?

I cannot get NeoVim to work like nano does out of the box with regards to clipboard copy/paste. Here is exactly what I am trying to do: I use either a linux laptop (Linux Mint) or a Chromebook ...
Andre Normandin's user avatar
2 votes
1 answer
177 views

How to diff the current text and the clipboard?

How to create a diff of the current text and the clipboard? It could result in a vertical split showing the clipboard content, and a normal diff between them. Opening a vertical split, pasting and ...
Volker Siegel's user avatar
1 vote
1 answer
507 views

Always duplicate yanked text to system clipboard

I'm using neovim 0.8.2 Is there a way to automatically mirror last yanked text to system clipboard, regardless of which register I used to yank it to? So if I run something like "ayiw I will have ...
xaxa's user avatar
  • 165
0 votes
1 answer
306 views

Nvim on WSL: escaping space in g:clipboard.paste['*']?

According to :h clipboard-wsl in neovim, For Windows WSL, try this g:clipboard definition: let g:clipboard = { \ 'name': 'WslClipboard', \ 'copy': { \ '+': 'clip.exe', \ ...
Dugesia7's user avatar
2 votes
1 answer
43 views

How do the * and + registrers behave in the virtual console?

My Vim is installed with +clipboard support, and all works just fine. I know that the clipboard comes with X, so there isn't such a thing in a virtual console (or, at least, this is what I've ...
Enlico's user avatar
  • 2,172
1 vote
0 answers
66 views

Vim only sometimes choosing to copy to system keyboard

I have the following situation. If I open a file in Vim, say by running vim myfile.tex, select something in visual mode, and do "+y, it is in the system clipboard as one would hope. If however I ...
jdc's user avatar
  • 141
24 votes
4 answers
6k views

I Have a Problem with Premature Yanking

If I've already yanked 37 lines, is there a way to send them to the clipboard without having to select them again? I need to move those yanked lines into a GUI application.
Lonnie Best's user avatar
1 vote
1 answer
736 views

Copying from Windows clipboard

On my Windows 10 box, when using git bash, I am able to righ-click on git bash window and choose paste to flush the contents of the Windows clipboard to my vi text buffer. Now, when I ssh into a ...
Gergely's user avatar
  • 263
0 votes
1 answer
182 views

Copy to clipboard and cut at the same time?

I often copy to clipboard into other programs (changed to <leader>y) is there a way to copy to the clipboard and delete once copied in one command? For example, I want to press <leader>y, ...
Vinn's user avatar
  • 649
-1 votes
1 answer
267 views

How to always paste to clipboard? [duplicate]

I am searching for an option to always paste to the system clipboard when using any kind of yank action, because I want to use Vim as the scrollback buffer for Kitty. I have already tried clipboard=...
neolith's user avatar
  • 133
0 votes
0 answers
288 views

Yanking to system clipboard does not work

I'm on Ubuntu 20.04.3 LTS, I have +clipboard and +xterm_clipboard in my vim --version, and I have set set clipboard=unnamedplus in my .vimrc. For some reason, yanking still does not copy to the system ...
Jin's user avatar
  • 185
3 votes
1 answer
2k views

gvim copy/paste shortcuts like in terminal : ctrl+shift+v / c

In terminal I use: Ctrl+Shift+c and Ctrl+Shift+v to copy & paste. I would like Ctrl+c, Ctrl+v in gVim to have standard Vim behaviour. How to configure gVim, so Ctrl+Shift+c and Ctrl+Shift+v become ...
Grzegorz Wierzowiecki's user avatar
0 votes
2 answers
499 views

"Copy" is greyed out in the Terminal menu after "Select All" in "VIM embedded in Terminal"; VIM copy does not work. How to copy the full file text?

I have set VIM as the default editor in the Terminal. I changed the ~/.bashrc: export VISUAL=vim export EDITOR="$VISUAL" You can also set the default editor only for git: git config --...
questionto42's user avatar
1 vote
1 answer
70 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 chars to the clipboard with, say,"+y100l. Ultimately, I want to copy chunks of ...
markling's user avatar
  • 319
7 votes
1 answer
592 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 ...
Shuzheng's user avatar
  • 1,195
0 votes
0 answers
176 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.
Drek's user avatar
  • 11
0 votes
0 answers
115 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 ...
user2153235's user avatar
1 vote
1 answer
248 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&...
Charles Kong's user avatar
3 votes
1 answer
332 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 ...
Quasímodo's user avatar
  • 2,416
5 votes
1 answer
682 views

How to set copyq to handle clipboard?

I want to let CopyQ clipboard manager handle clipboard (I am using set clipboard+=unnamed setting). To that end, this setting was added to init.vim file: let g:clipboard = { \ 'name': '...
laur's user avatar
  • 159
2 votes
1 answer
831 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 ...
Hrolfson's user avatar
6 votes
1 answer
295 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 ...
Enlico's user avatar
  • 2,172
0 votes
0 answers
34 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 ...
Gergely's user avatar
  • 263
0 votes
1 answer
136 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 ...
Andrew Ferrier's user avatar
4 votes
2 answers
1k 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. ...
TornaxO7's user avatar
  • 561
6 votes
3 answers
2k views

Install Vim with +clipboard support but without Gvim?

My distribution comes with a minimal version of Vim. vim --version returns -clipboard, so the * and + registers interact (copy/paste) with the primary and clipboard do not work. The resources I've ...
Quasímodo's user avatar
  • 2,416
0 votes
1 answer
412 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 + ...
hlovdal's user avatar
  • 203
1 vote
1 answer
12k 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 ...
niekas's user avatar
  • 1,545
0 votes
1 answer
43 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 ...
Shuzheng's user avatar
  • 1,195
2 votes
0 answers
304 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 ...
hexaquark's user avatar
  • 121
3 votes
1 answer
638 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 ...
Gideon Sassoon's user avatar
0 votes
1 answer
2k 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?
NeoZoom.lua's user avatar
  • 1,302
0 votes
1 answer
303 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. ...
arnabanimesh's user avatar
0 votes
3 answers
1k 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 ...
silviubogan's user avatar
0 votes
1 answer
309 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 ...
Merajul Arefin Pial's user avatar
3 votes
2 answers
813 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 ...
Antsamotady's user avatar
1 vote
1 answer
500 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 ...
Quasímodo's user avatar
  • 2,416
1 vote
0 answers
56 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 ...
David542's user avatar
  • 2,365
4 votes
0 answers
1k 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 ...
sh.3.ll's user avatar
  • 201
10 votes
5 answers
3k 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 ...
ng.newbie's user avatar
  • 245
0 votes
2 answers
172 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 ...
PatMcTookis's user avatar
1 vote
2 answers
281 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 ...
Flimm's user avatar
  • 2,182
1 vote
1 answer
774 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 ...
user7802048's user avatar