使用 ideavim 的 Intellij IDEA。不能从其他来源复制文本

我尝试用 ideavim 插件从 IDEA 复制文本,使用默认的 vim keybindings ()。但是这个文本不是复制在全局缓冲区,我可以粘贴它只在 IDEA。
例如,我如何在浏览器中使用复制的文本?

30988 次浏览

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.

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:

enter image description here

Then search for the shortcut and select the option IDE for handler.

enter image description here