Golang编程语言知识介绍


  • 首页

  • todo

  • 思考

  • life

  • food

  • OS

  • lua

  • redis

  • Golang

  • C

  • TCP/IP

  • ebpf

  • p4

  • OpenVPN

  • IPSec

  • L2TP

  • DNS

  • distributed

  • web

  • OpenWRT

  • 运维

  • Git

  • 鸟哥的私房菜

  • IT杂谈

  • 投资

  • About Me

  • 友情链接

  • FTP

  • 搜索
close

Vim鼠标右键无法粘贴

时间: 2022-05-31   |   分类: 运维     |   阅读: 685 字 ~2分钟

​ 最近维护一台服务器,使用putty登录后,用vim时,鼠标右键不能粘贴而是进入了visual模式。网上查找一番找到了解决方法:

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

​ 方法二:编辑 ~/.vimrc 文件,加入如下代码: if has(‘mouse’) set mouse-=a endif 方法一每次打开vim时都需要设置一次。方法二改了配置文件后,问题就解决了。 参考:www.varesano.net/blog/fabio/disable%20vim%20automatic%20visual%20mode%20using%20mouse

(转)

之前,为了解决一个语法加亮的问题更改了vimrc,之后,突然发现鼠标可以使用了,点到那里光标就定位到 那里,但是,随后发现,ctrl+shift+c不能用了,鼠标右键复制选项也是灰的。 到网上,搜了一下,发现是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在可视模式下使用鼠标,然后搞定。

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

又到网上找了下,发现确实这样,不过却另有所获: 无须更改set mouse=a

用鼠标选中,按y键复制,然后点击要粘贴的地方使用鼠标中键粘贴!!! 支持夸文件粘贴,比使用命令方便多了

#运维#
OpenVPN协议解析之网络结构之外
共识算法Raft
shankusu2017@gmail.com

shankusu2017@gmail.com

日志
分类
标签
GitHub
© 2009 - 2025
粤ICP备2021068940号-1 粤公网安备44011302003059
0%