热门标签 | HotTags
当前位置:  开发笔记 > 开发工具 > 正文

如何在不进入插入模式的情况下用鼠标选择文本

如何解决《如何在不进入插入模式的情况下用鼠标选择文本》经验,为你挑选了1个好方法。

我曾经能够在Vim中用鼠标选择文本,然后单击x以将其剪切。现在,当我这样做时,它确实像以前一样将文本剪切到剪贴板上,但是它还x在剪切点插入了一个字符,这在过去是不会发生的。似乎用鼠标选择文本使我进入了插入模式,因此随后的击中x确实将文本剪切到了剪贴板上,而且还插入了一个xASCII字符。

我最近更换了机器,因此丢失了_vimrc(Windows)文件。我可能在旧的_vimrc中进行了一些键重映射,以完成所需的操作,但不再有权访问该文件。

如果我用鼠标选择文本并点击,也会发生类似的情况d。文本被剪切到剪贴板上,并且d插入了一个字符,并且我处于文本插入模式。

有谁知道要添加到我的_vimrc(.vimrc)中的行以创建行为,以便当我用鼠标选择多行文本并单击时x,它将把文本剪切到剪贴板上,而不是在原位插入任何文本,并且让我进入命令模式?

我的mouse设置设置为mouse=a



1> DJMcMayhem..:

这称为“选择模式”。来自: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


推荐阅读
author-avatar
中二丶夜夜
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有