putty vi右键不能黏贴

环境:kali2018镜像,Hyper-v虚拟机

背景:在设置好ssh远程登录后使用putty打开source文件添加更新源

结果复制的更新源右键无法黏贴,

 

解决:

方法一:在普通模式下键入“ :set mouse-=a”(不包括引号)

方法二:编辑 ~/.vimrc 文件,加入如下代码:

if has('mouse') set mouse-=a endif

方法一每次打开vim时都需要设置一次。方法二改了配置文件后,问题就解决了。

 

set mouse=a

这个是用来开启鼠标功能的。a表示所有模式

vi的三种模式:命令模式,插入模式,可视模式.鼠标可以启动于各种模式中:
The mouse can be enabled for different modes:
n Normal mode
v Visual mode
i Insert mode
c Command-line mode
h all previous modes when editing a help file
a all previous modes
r for |hit-enter| and |more-prompt| prompt
Normally you would enable the mouse in all four modes with:
:set mouse=a
When the mouse is not enabled, the GUI will still use the mouse for
modeless selection. This doesn't move the text cursor.

所以配置文件中的set mouse=a启动了所有模式,这样就屏蔽了鼠标右健功能.

这里我设置为set mouse=v在可视模式下使用鼠标,然后搞定。

但是,这样,其他模式就无法使用鼠标定位了,有点不爽。莫非鱼和熊掌不能兼得??

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值