Questions tagged [os-clipboard]
Questions about interfacing with the system's clipboard.
93
questions
0
votes
1
answer
43
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, ...
-1
votes
1
answer
53
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=...
0
votes
0
answers
44
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 ...
1
vote
0
answers
29
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 ...
0
votes
2
answers
69
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 --...
1
vote
1
answer
60
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 ...
7
votes
1
answer
393
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
0
answers
33
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
0
answers
66
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
1
answer
82
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
1
answer
116
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
0
answers
152
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': '...
2
votes
1
answer
256
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
1
answer
203
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
0
answers
23
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
1
answer
60
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
2
answers
244
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
2
answers
486
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
1
answer
50
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
1
answer
2k
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
1
answer
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
0
answers
46
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
1
answer
332
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
1
answer
544
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
1
answer
178
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
3
answers
145
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
1
answer
65
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
2
answers
287
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
1
answer
292
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
0
answers
53
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
0
answers
527
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 ...
6
votes
4
answers
1k
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
2
answers
80
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
2
answers
168
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
1
answer
410
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
1
answer
464
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
1
answer
594
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
1
answer
181
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
2
answers
1k
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
0
answers
58
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
2
answers
273
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
0
answers
132
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
1
answer
382
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
2
answers
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
2
answers
652
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
2
answers
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
1
answer
60
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
0
answers
75
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
0
answers
25
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
1
answer
549
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 ...