解决vim使用鼠标选择便进入visual mode问题


  • 如果只是临时想关闭一下,直接vim进入命令行模式,使用命令
    :set mouse-=a
  • 如果是直接觉得不需要这个功能
    vim ~/.vimrc加入该项配置

:set mouse-=a

Vim的set mouse说明

    Enable the use of the mouse.  Works for most terminals (xterm, Win32
    win32-mouse, QNX pterm, *BSD console with sysmouse and Linux console
    with gpm).  For using the mouse in the GUI, see gui-mouse.  The
    mouse can be enabled for different modes:
            n       Normal mode and Terminal modes
            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

补充说明

'-='什么意思?

一般使用直接使用’='对其赋值
‘+=’ '-='可以用来向该配置项追加/去除指定值

家目录下没有 .vimrc 文件

不一定有,可以自己建立
可以使用包管理查询Vim相关文件,它会显示Vim参考文件的位置
比如
opkg files vim-fuller | grep vimrc

/usr/share/vim/vimrc
/usr/share/vim/vim82/gvimrc_example.vim
/usr/share/vim/vim82/vimrc_example.vim

有的没的

也有文章说,可以保留命令行模式下的鼠标选择:set mouse=c
同时,:set mouse=:set mouse-=a应该可以实现相同效果


参考文章:

Vim help doc
vim insert VISUAL模式无法右键复制问题(转)

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值