GVim Win32 中仅使用键盘选择列块,或者为什么在包含 mswin.vim 时 Ctrl-Q 不模拟 Ctrl-V?

2024-01-05

我希望在 Windows 上使用 Vim 时能够仅使用键盘来选择柱状块,但在 Windows XP 上使用 vim (7.2) 时似乎无法这样做。编辑:为了方便起见,最好使用箭头键进行选择,就像其他版本的 vi/vim 中通常所做的那样。

In a terminal, when using vim, to define a block, one may select columnar blocks by pressing Ctrl-V and by conveniently moving the cursor with the arrow keys.

When using GVim on mswin, Ctrl-V is mapped to a paste operation. Every reference found on this topic mentions that on mswin, Ctrl-Q is set to act the same way that Ctrl-V works on other platforms, but this does not work for me.

After research indicated that the Ctrl-Q behavior is implemented through the inclusion of mswin.vim, it seemed that perhaps mswin.vim was not being loaded by GVim. mswin.vim is apparently loaded via _vimrc. It seemed that perhaps mswin.vim was not loading, so perhaps _vimrc was not setup correctly, but...

C:\Program Files\Vim\_vimrc存在包含:

source $VIMRUNTIME/mswin.vim
behave mswin

C:\Program Files\Vim\vim72\mswin.vim存在并包含:

" Use CTRL-Q to do what CTRL-V used to do
noremap <C-Q>       <C-V>

C:\Program Files\Vim\_vimrc应该从编辑 | 开始加载GVim图形菜单中的Settings Window加载这个文件进行编辑,很明显C:\Program Files\Vim\vim72\mswin.vim正在加载,因为可以在该文件中插入语法错误,并且 GVim 在启动时会抱怨它(已对其进行备份以进行测试并恢复以防止意外损坏)。

When Ctrl-Q is pressed, the cursor changes in the same way that it changes when you block select text using the mouse, but any cursor movement at this point causes the cursor to change back to a normal cursor. It does not matter whether one continues to hold Ctrl, Ctrl-Q, or not.

Edit: Ctrl-Q enters block selection mode as indicated by the cursor change since other cursor movement commands extend the block, however, the original intent of this question was to learn how to use the arrow keys (in the same manner that they are able to be used in other implementations of the editor) though this was not explicitly stated in the original, unanswered revisions of the question.

It is possible to visually select columnar blocks by pressing Alt while holding down the left-mouse button, but Alt during arrow key motion after pressing Ctrl-Q also does not work.

Research also seemed to indicate that pressing v in command-mode would enter visual-mode, and that perhaps this was relevant, but using this does not seem to help the situation.

C:\Program Files\Vim\vimfiles除了空目录结构之外不包含任何内容。C:\Documents and Settings\username不包含vim配置文件,也不包含C:\Documents and Settings\username\My Documents。其他C:\Documents and Settings\username通常存储应用程序特定或本地设置的位置似乎也没有 vim 设置。 %HOMEDRIVE% 和环境变量也是如此。


One way to visually select column blocks in GVim on Win32 using only the keyboard is to press Ctrl-Q, release it, then press and hold down the Shift key while using the arrow keys to select the column block.

Why Ctrl-Q columnar selection behaves this way is not known, but it does not really matter since the goal was to select column blocks using only the keyboard. In Vim, Shift is not used when using Ctrl-V to select blocks.

:help mswin does not mention this nuance of the CTRL-V alternative.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

GVim Win32 中仅使用键盘选择列块,或者为什么在包含 mswin.vim 时 Ctrl-Q 不模拟 Ctrl-V? 的相关文章

  • 在进程完成之前,Windows cmd.exe 中的管道不会转发标准输出?

    考虑 Windows 命令 shell cmd exe 中的管道 C gt feed filter 直到进料过程运行完成之后 进料过程的标准输出似乎才达到过滤过程的标准输入 这种类型的 缓冲 可能会导致长时间运行的馈送过程的输出消息出现烦人
  • std::string 到 LPCTSTR

    新版本典型问题如何转换而来std string to LPCTSTR 从不同的帖子中我了解到我应该这样做 CreateDirectory path c str NULL 编译器仍然给出错误 因为cannot convert from con
  • 在 Windows 中使用脚本添加代理设置例外

    我使用的是 Windows 7 并且有一个在启动时初始化的代理配置 每次重新启动电脑时 我都必须重新打开代理设置并手动添加新的代理例外 IP 地址 例如每次重新启动时 www google com www yahoo com www fac
  • 在命令提示符中识别“Pip”,但在 PyCharm 终端中无法识别

    当我尝试在 Windows 命令提示符中运行 pip 时 pip V工作正常 但是当我尝试在 PyCharm 终端中运行它时 我得到 pip is not recognized as an internal or external comm
  • Anaconda (Python) - Windows 10 上的 Cmder 集成

    我在 Windows 10 64 位上通过 Anaconda 让 Cmder 使用 Python 时遇到了一些麻烦 我让 Anaconda 工作得很好 测试过用 matplotlib 绘制一些东西 它与 Anaconda Prompt 一起
  • 在 Windows 上为 Bitbucket 设置 SSH 密钥

    首先 我对 git repos 和命令行绝对是菜鸟 我在 Bitbucket 上有仓库 我基本上希望能够通过 gitbash 推送到存储库 而无需每次输入密码 我拥有的 Bitbucket 上的存储库已设置好代码 克隆存储库的本地目录 通过
  • Git,无法在 Windows 上克隆存储库

    我正在尝试在 Windows 上使用 git 克隆远程存储库 我可以在我的 mac 上克隆它 但在 Windows 上我遇到了问题 当使用 git bash 克隆时 我收到一条消息 指出服务器的主机密钥未缓存在注册表中 它要求我按 y 或
  • 无法使用安装了启用的 Hyper-V 和 WSL2 的 VirtualBox 启动 Windows 10 客户机 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我最近将 Windows 10 版本更新为2004 我还将 WSL 更新为 WSL2 我在尝试通过 VirtualBox 使用虚拟机 Wi
  • SVN提交失败,访问被禁止

    最近我面临着提交SVN的问题 我使用的SVN服务器是VisualSVN Server 2 5 9 客户端是TortoiseSVN 1 7 12 起初 一个用户在将文件提交到 SVN 时遇到问题 但该用户仍然可以访问存储库并下载更新 第二台
  • 使用 Vim 作为 HTML 编辑器

    您知道 Notepad 如何具有此功能 当您单击标签 例如 时 它也会自动突出显示结束标签 它叫什么 如何调整 Vim 使其也具有此功能 还有其他方法可以将 Vim 变成强大且高效的 HTML 编辑器吗 我在 vim 中完成所有 HTML
  • C++:获取注册表值仅给出第一个字符[重复]

    这个问题在这里已经有答案了 我试图从注册表中获取字符串值 但我只得到第一个字母 HKEY hKey char gamePath MAX PATH if RegOpenKeyEx HKEY CURRENT USER L Software Bl
  • Gtkmm 程序编译正常但崩溃 - Windows XP

    我最近安装了 gtkmm gtkmm 2 4 当我使用 g 编译时 我使用 pkg config 中的以下信息 头文件 pkg config gtkmm 2 4 cflags 目标文件 pkg config gtkmm 2 4 libs 所
  • 二进制模式下的 Windows 管道

    我在windows中编写了一个程序 它将播放通过stdin发送给它的二进制音频 我将其称为play 就像linux程序一样 然后我写了一个单独的程序如下 FILE f popen aplay exe wb FILE song fopen C
  • 如何在 Windows Docker 容器中启动 PowerShell (x86)?

    我正在尝试从 PowerShell 启动 Windows Docker 容器中的 PowerShell x86 但它不会启动新的 shell 我正在从 AWS Windows EC2 运行 DockerWindows Server 2019
  • 什么进程正在使用给定的文件?

    我的一个脚本遇到了问题 它似乎无法规律地写入自己的日志 并抛出错误 此文件正在被另一个进程使用 我知道有一些方法可以用 try excepts 来处理这个问题 但我想知道why这种情况正在发生 而不仅仅是掩盖它 根本不应该有任何其他东西访问
  • 检测 C++/Win32 中的进程崩溃

    我正在开发一个包含 2 个程序的软件 Qt Main exe OpenGL Game exe 我们一开始总是使用 Qt Main exe 当我们点击 开始游戏 按钮时 我们执行OpenGL Game exe 这样做没问题 问题是 有时我们的
  • 设置透明背景Win32

    我想做的事情非常简单 但似乎没有太多信息 基本上我有一个普通的不透明父窗口 我想在该父窗口内放置一个子窗口 有自己的不透明控件 所以我唯一要做的就是将子窗口的背景画笔设置为透明 但它仍然绘制白色背景 尝试使用 WS EX LAYERED 样
  • git commit 保存 vim 文件时出错

    我正在遵循简单的 git 指南nettuts 简易 git 指南 http net tutsplus com tutorials other easy version control with git 我在我的中初始化了一个空的 git 实
  • Windows GUI 控件 ID 是如何创建的?

    在 Windows 中 对于每个控件 例如每个对话框 窗口 文本框和复选框等 都会给出一个控件 ID 这个控件id是如何创建的 Windows 中的两个应用程序可以具有相同的控件 ID 吗 有没有办法手动设置 Windows 控件 ID 控
  • 让 Windows 尝试读取文件

    我正在对 Windows 文件系统进行某种封装 当用户请求打开文件时 Windows 调用我的驱动程序来提供数据 在正常操作中 驱动程序返回缓存的文件内容 但是 在某些情况下 实际文件没有缓存 我需要从网络下载它 问题是是否有可能让 Win

随机推荐