我曾经能够在Vim中用鼠标选择文本,然后单击x以将其剪切。现在,当我这样做时,它确实像以前一样将文本剪切到剪贴板上,但是它还x
在剪切点插入了一个字符,这在过去是不会发生的。似乎用鼠标选择文本使我进入了插入模式,因此随后的击中x确实将文本剪切到了剪贴板上,而且还插入了一个x
ASCII字符。
我最近更换了机器,因此丢失了_vimrc(Windows)文件。我可能在旧的_vimrc中进行了一些键重映射,以完成所需的操作,但不再有权访问该文件。
如果我用鼠标选择文本并点击,也会发生类似的情况d。文本被剪切到剪贴板上,并且d
插入了一个字符,并且我处于文本插入模式。
有谁知道要添加到我的_vimrc(.vimrc)中的行以创建行为,以便当我用鼠标选择多行文本并单击时x,它将把文本剪切到剪贴板上,而不是在原位插入任何文本,并且让我进入命令模式?
我的mouse
设置设置为mouse=a
。
这称为“选择模式”。来自:h Select-mode
:
8. Select mode *Select* *Select-mode* Select mode looks like Visual mode, but the commands accepted are quite different. This resembles the selection mode in Microsoft Windows. When the 'showmode' option is set, "-- SELECT --" is shown in the last line. Entering Select mode: - Using the mouse to select an area, and 'selectmode' contains "mouse". 'mouse' must also contain a flag for the current mode. - Using a non-printable movement command, with the Shift key pressed, and 'selectmode' contains "key". For example:and . 'keymodel' must also contain "startsel". - Using "v", "V" or CTRL-V command, and 'selectmode' contains "cmd". - Using "gh", "gH" or "g_CTRL-H" command in Normal mode. - From Visual mode, press CTRL-G. *v_CTRL-G*
存在于该模式背后的原因可以在“ 什么是选择模式以及何时使用该选择模式? ”中找到。
要禁用正在使用鼠标选择内容而进入的选择模式,请添加
set selectmode=
给你 .vimrc