linux vim 不用鼠标,Vim 8.0 于 Linux 使用鼠标选取自动复制的快速键

Vim 8.0 于 Linux 的 CLI 环境,使用鼠标选取文本的话,缺省不是 Xwindow 的选取方式,而是 Vim 内部的选取方式(v),所以文本要复制没办法使用 Ctrl + c 等等复制到系统的内存。

注1:缺省为 set mouse=a 的模式

注2:Debian stretch 目前安装就是 Vim 8.0,就会遇到此情况

想要复制到系统的内存,可以使用下述两种方式:

按住 Shift 后,在用鼠标选取,可以使用 Ctrl + c 复制,或 此时用鼠标中间就可以粘贴。(再按一下 Shift 选取反白才会消失)

:set mouse= 或 :set mouse=r (设置不要为 a 就可以使用标准系统的选取、复制模式)

相关说明

*'mouse'* *E538*

'mouse' string (default "", "a" for GUI, MS-DOS and Win32)

global

{not in Vi}

Enable the use of the mouse. Only works for certain terminals

(xterm, MS-DOS, 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

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.

See |mouse-using|. Also see |'clipboard'|.

Note: When enabling the mouse in a terminal, copy/paste will use the

"* register if there is access to an X-server. The xterm handling of

the mouse buttons can still be used by keeping the shift key pressed.

Also see the 'clipboard' option.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值