vim 可以默认使用系统剪贴板吗? [英] Can vim use the system clipboard(s) by default?

查看:29
本文介绍了vim 可以默认使用系统剪贴板吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了几个问题 因为 vim 的选项卡,由于缺乏更好的术语,太糟糕了.我想开始使用多个 Gnome 选项卡,每个选项卡都有一个不同的 vim 实例.一切正常,但是,只有系统缓冲区 + 可用于共享文本.这使所有命令的两个按键更长:

I am running into several problems because vim's tabs are, for the lack of a better term, god awful. I want to start using multiple Gnome tabs instead, each with a different instance of vim. Everything should work fine, however, only the system buffer + can be used to share text. This makes all the commands two key strokes longer:

y y 变成 " + y y

y w 变成 " + y w

d ' k 变成 " + d ' k

当人们认为像这样简单的 yank/paste 操作时尤其如此

This is especially so when one considers that a simply yank/paste operation like so

y y p

变成

" + y y " + p

无论如何要指示vim始终使用系统剪贴板?

Is there anyway to instruct vim to always use the system clipboard(s)?

编辑 参见此处,了解有关在 Gnome 终端选项卡中使用多个 vim 实例的更多信息

EDIT see Here for more information on using multiple instances of vim across Gnome Terminal Tabs

推荐答案

我在这里找到了解决我的问题的方法.如果将以下内容添加到 .vimrc 文件

I found a solution to my problem here. If you add the following to your .vimrc file

set clipboard=unnamedplus

你在 vim 中提取的所有内容都将进入未命名的寄存器,反之亦然.

Everything you yank in vim will go to the unnamed register, and vice versa.

这篇关于vim 可以默认使用系统剪贴板吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆