是否可以直接从Vim复制到剪贴板?yy只把东西复制到Vim的内部缓冲区。我想复制到操作系统的剪贴板。在Vim中有这样的命令吗?或者你只能在Vim中提取东西?
当前回答
以上这些在我的windows笔记本电脑上都不起作用。
Ctrl+C可以用于复制。但我需要 Shift+插入到粘贴!
(一个很好的理由,总是有一个笔记本电脑,可以随时插入,而不需要按第二个键)
其他回答
我的解决方案是安装额外的vim,包括剪贴板选项:
sudo apt-get install vim-gnome
对于一些国际键盘,您可能需要按“+空格获得a”。
所以在这种情况下,你必须按“空格+y”或“空格*y”
In case you don't want to use any graphical interface for vim and you prefer to just stick with terminal emulator there may be a much simpler approach to this problem. Instead of using yank or anything like this, first take a look at documentation of terminal you use. I've been struggling with the same issue (trying to use +clipboard and xclip and so on) and in the end it turned out that in my terminal emulator it's enough to just press shift and select any text you want to copy. That's it. Quite simple and no need for messing with configuration. (I use urxvt by the way).
你可以在这里找到答案 拱维基
Linux: 首先,你必须通过安装在你的vim版本中启用剪贴板 gvim。
接下来,您必须将这一行放到.vimrc文件中。
设置剪贴板= unnamedplus
如果您通过putty连接到Unix系统,那么按照以下步骤复制文件的内容
突出显示要复制的文本(您将能够逐页复制) 按ctrl+c(它将复制文本到剪贴板 粘贴任何外部编辑器 完成