Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
74 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
2 answers
597 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
1 vote
3 answers
385 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
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
335 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
179 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
1k 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
  • 199
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
0 votes
1 answer
229 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
0 votes
0 answers
420 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
0 votes
2 answers
892 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
74 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
  • 409
3 votes
1 answer
416 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
0 votes
0 answers
35 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
60 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,315
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,590
0 votes
1 answer
350 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
0 votes
1 answer
435 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
2k 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
630 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,486
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 ...
1zverg's user avatar
  • 211
10 votes
6 answers
4k views

Clipboard is reset after first paste in Visual mode

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 go to the original source and then do the copy ...
ng.newbie's user avatar
  • 255
1 vote
2 answers
377 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,463
1 vote
1 answer
893 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
2 votes
1 answer
1k 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", @")&...
brother-bilo's user avatar
10 votes
2 answers
4k 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 ...
user avatar
6 votes
0 answers
198 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 ...
Muzer's user avatar
  • 161
3 votes
2 answers
5k 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 ...
Jon's user avatar
  • 131
7 votes
2 answers
1k 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 ...
Cat's user avatar
  • 131
16 votes
3 answers
2k 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 ...
Maxim Kochurov's user avatar
15 votes
3 answers
10k 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....
erwin's user avatar
  • 281
1 vote
2 answers
3k 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 ...
john-jones's user avatar
7 votes
1 answer
10k 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 ...
Sparhawk's user avatar
  • 600
6 votes
0 answers
110 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 * ...
DmitMedv's user avatar
  • 161
7 votes
1 answer
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 ...
jalalhugo's user avatar
3 votes
1 answer
6k 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 ...
fuzzybear3965's user avatar
5 votes
1 answer
1k 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 ...
muru's user avatar
  • 25.1k
11 votes
6 answers
33k views

How do I copy and paste between two Vim instances - shared clipboard?

I use gnu screen and I run vim file1.txt and vim file2.txt in two windows. How can I copy part of the text from file1.txt and paste it to file2.txt without using temporary files or opening two files ...
name's user avatar
  • 965
6 votes
2 answers
13k 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. ...
OrangeTux's user avatar
  • 3,606
515 votes
15 answers
714k 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?
thameera's user avatar
  • 17.8k