Skip to main content

Questions tagged [os-clipboard]

Questions about interfacing with the system's clipboard.

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

How can I use the primary clipboard in a terminal emulator under Wayland?

When running vim in a terminal emulator under X11, any text selected in visual mode would be added to the primary clipboard, as expected. In addition, manually using the * register would also work. In ...
Sparhawk's user avatar
  • 590
0 votes
1 answer
51 views

Vim visual block copy don't paste in KDE konsole

Selecting by visual line mode and copying (V and y) in vim in rxvt-unicode or in gnome-terminal and pasting in another tab of that terminal with Shift + Insert works well. But trying to do the same ...
pevik's user avatar
  • 109
0 votes
0 answers
31 views

How to enable Ctrl+alt+c copy to system clipboard from neovim buffer?

I would like to use Ctrl+Alt+c / Ctrl+Alt+v to copy and paste to a vim buffer just like I'm able to in a terminal. While Ctrl+Alt+v works to paste stuff from system clipboard to the buffer, copying ...
glades's user avatar
  • 23
0 votes
2 answers
126 views

How do I synchronize system clipboard and nvim clipboard?

I would like to synchronize the system and nvim clipboards so I don't have to do anything extra to copy and paste. I want to do (since I am on MacOS) command c to copy and command v to paste, inside ...
BigMistake's user avatar
0 votes
1 answer
119 views

Neovim blocks kitty select to copy and click on url to open with mouse

Kitty has configuration like opening a url in browser when it is clicked and copying text selected with a mouse to clipboard automatically. This works on Vim but does not work in Neovim. How can these ...
rkochar's user avatar
  • 103
0 votes
2 answers
85 views

How to copy text to clipboard from status bar (statusline) in Vim

Problem is present when there is the following option for mouse in ~./vimrc: set mouse=a | " active
Anton Samokat's user avatar
0 votes
1 answer
62 views

How can I copy the current filename and line number to the clipboard?

How can I copy the current file name and line number to the system clipboard, formatted like this: relative/path/to/file:123 And how can I map this to a leader key command?
Nathan Long's user avatar
1 vote
1 answer
276 views

Copy from Visual mode to clipboard using Wayland

This works well when I'm not using Wayland on Fedora 39 KDE: nnoremap <C-c> "+ vnoremap <C-c> "+y But this doesn't work anymore on Wayland. What can I do to make it work? My vi -...
m26a's user avatar
  • 121
1 vote
1 answer
100 views

Choices for pasting

In my local PC I use p in Vim command mode for pasting and it works fine and the :echo has('clipboard') returns 1. But, in the cluster I am working p in command mode, which just inserts a 0 instead of ...
Dimitris Tsiaousidis's user avatar
1 vote
3 answers
326 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
93 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
1 answer
1k 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
289 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
147 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
1 vote
1 answer
952 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
1 vote
1 answer
761 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
3 votes
1 answer
387 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
960 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
  • 177
0 votes
1 answer
475 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
957 views

When I use the yank command in Vim, is the text saved into a buffer that is not visible to the user?

I understand the concept of a buffer. It is the text that's saved from a file that we edit inside of Vim. When I use the yy command, where exactly does Vim save this information to? In any other ...
KrabbyPatty's user avatar
2 votes
1 answer
45 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,256
1 vote
0 answers
83 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
1k 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
  • 293
0 votes
1 answer
223 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
  • 791
-1 votes
1 answer
318 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
399 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
4k 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
835 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
71 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
  • 399
8 votes
1 answer
659 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,285
0 votes
0 answers
186 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
143 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
320 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
406 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,486
5 votes
1 answer
979 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
1k 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
324 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,256
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
  • 293
0 votes
1 answer
341 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
5 votes
2 answers
2k 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
  • 591
6 votes
3 answers
3k 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,486
1 vote
1 answer
590 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
  • 223
1 vote
1 answer
14k 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,705
0 votes
1 answer
52 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,285
3 votes
0 answers
412 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
  • 131
3 votes
1 answer
719 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,570
0 votes
1 answer
337 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
2k 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