从vim中复制文本,set mouse = a enabled [英] Copy text out of vim with set mouse=a enabled

查看:1867
本文介绍了从vim中复制文本,set mouse = a enabled的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的.vimrc中启用了一个选项 set mouse = a ,从那时起,我就无法在vim之外复制和粘贴文本。
基本上,用鼠标选择触发器vim打开视觉模式并且在弹出菜单中禁用复制选项:

I've recently enabled an option set mouse=a enabled in my .vimrc and since then there is no way for me to copy and paste text outside the vim. Basically, the select with mouse triggers vim to turn the visual mode on and Copy option is disabled in the popup menu:

有没有办法在vim之外复制? p>

Is there any way to copy outside vim now?

推荐答案

使用鼠标选择时按 shift 这将使鼠标选择的行为像 mouse = a 没有启用。

Press shift while selecting with the mouse. This will make mouse selection behave as if mouse=a was not enabled.

em>这个技巧也适用于中间按钮粘贴:如果要粘贴到外部选择的vim文本中,请按 shift ,同时单击中间按钮。只需确保在这样做时激活插入模式(您可能还想要:设置粘贴以避免意外效果)。

Note: this trick also applies to "middle button paste": if you want to paste in vim text that was selected outside, press shift while clicking the middle button. Just make sure that insert mode is activated when you do that (you may also want to :set paste to avoid unexpected effects).

OS X(mac):
选择时保留alt /选项(

OS X (mac): hold alt/option while selecting (source)

这篇关于从vim中复制文本,set mouse = a enabled的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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