I tried to copy text from IDEA with ideavim plugin, using default vim keybindings (y). But this text isn't copied in global buffer and i can paste it only in IDEA.
How can I use copied piece of text in browser, for example?

- 1,135
- 3
- 8
- 10
-
1Okay, i got it. In IDEA keymap settings for Copy action are set 2 combinations: Ctrl + c and Ctrl + Insert. I don't know why Ctrl + c isn't working, but now I use second one. – Supo Jan 13 '15 at 09:10
-
2Ctrl+C isn't working because it is handled by Vim. You can change this behaviour in "Other Settings -> Vim Emulation" by setting 'Handler' to IDE. – Michal Lonski Jan 10 '18 at 07:04
2 Answers
Vim's yank command doesn't yank to the system clipboard by default; it yanks to the unnamed register. You can use the * or + register to access the system clipboard; also see this wiki article for more information. Or just set this option in your ~/.ideavimrc
:
set clipboard+=unnamed
This ~/.ideavimrc
setting has been supported in IdeaVim since VIM-476 was implemented in version 0.38. If the file does not exist create it in your user/home directory.
Note also that this is all standard Vim behavior; none of it is specific to IdeaVim except for the name of the config file.
-
20`set clipboard+=unnamed` uses the `*` register, aka primary selection. If you prefer to use register `+`, aka clipboard, then ``set clipboard+=unnamedplus`. You can also set these interactively from the `:` prompt to experiment and see what works best for you. – Laurence Gonsalves May 18 '16 at 01:55
-
3If you are on Windows and are looking for .ideavimrc, then see https://stackoverflow.com/a/33404917/6441900 – SantaXL May 26 '19 at 21:54
-
-
If you're like me and can't remember the command to yank into a register, it's `"+y` with a selection in visual mode. – Matthew Jun 03 '23 at 07:20
-
you can find an interesting discussion here https://gist.github.com/RobertAudi/11ffa90f4952e5923ce7 – Albert Bici Aug 03 '23 at 08:33
Another option is that you can go to the setting of the ideavim plugin and set ctrl + c
and ctrl + v
to be handled by the IDE and not by vim.
This will allow you to copy and paste as usual in the IDE and paste outside the IDE as well.
Note
when you set ctrl + v
to be handled by the IDE ctrl + v
for selection will not work in VIM. As an alternative you might just use ctrl + shift + v
in IDE as default (works by default for paste with selection)
Steps
in your lower right corner select settings:
Then search for the shortcut and select the option IDE
for handler.

- 710
- 10
- 24