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上模拟socket.socketpair

    标准Python函数套接字 套接字对 https docs python org 3 library socket html socket socketpair不幸的是 它在 Windows 上不可用 从 Python 3 4 1 开始 我
  • 游戏内的java.awt.Robot?

    我正在尝试使用下面的代码来模拟击键 当我打开记事本时 它工作正常 但当我打开我想使用它的游戏时 它没有执行任何操作 所以按键似乎不起作用 我尝试模拟鼠标移动和点击 这些动作确实有效 有谁知道如何解决这个问题 我发现这个问题 如何在游戏中使用
  • 如何从Windows阻止社交媒体[关闭]

    Closed 这个问题需要调试细节 help minimal reproducible example 目前不接受答案 我想根据时间阻止我的电脑上的社交媒体 晚上 9 点后屏蔽 上午 11 点后解锁 如家长控制 我尝试过关注但失败了 创建了
  • 如何禁用vim的switch case缩进?

    我目前正在与 Vim 作斗争 我似乎无法让缩进选项达到我想要的效果 这是我的设置 我将它们放在 vimrc 的底部以确保它们优先 正如你所看到的 我有点疯狂 所以我尝试关闭几乎所有的东西 set cindent set cinkeys o
  • 在.vimrc中设置expandtab不生效

    由于某种原因set expandtab命令在我的 vimrc文件没有任何作用 这是我的 vimrc tab settings set expandtab set smarttab set softtabstop 2 set tabstop
  • 代码折叠未保存在我的 vimrc 中

    我将以下代码添加到我的 vimrc 中 save and restore folds when a file is closed and re opened autocmd BufWinLeave mkview autocmd BufWin
  • SetCurrentDirectoryW 中的错误 206

    在我之后之前不清楚的问题 https stackoverflow com questions 44389617 long path name in setcurrentdirectoryw 我以某种方式能够创建一个具有长路径名的目录 但是
  • 如何查看网络连接状态是否发生变化?

    我正在编写一个应用程序 用于检查计算机是否连接到某个特定网络 并为我们的用户带来一些魔力 该应用程序将在后台运行并执行检查是否用户请求 托盘中的菜单 我还希望应用程序能够自动检查用户是否从有线更改为无线 或者断开连接并连接到新网络 并执行魔
  • 我应该在 .vimrc 文件中使用单引号还是双引号?

    单个 和双 在 Vim 中引用 它会造成速度差异吗 在其中运行函数时 使用其中一个更好还是另一个更好 这有什么关系吗 我对它们在以下方面的用途特别感兴趣 vimrc file 我这么问是因为我发现人们在同一件事上使用这两种方法 我想知道它们
  • 卸载以前的版本安装新版本的安装项目

    我创建了一个安装项目并安装在Windows系统中 在安装安装项目之前 我将其设置为 DetectNewInstallerVersion true and RemovePreviousVersion True 我也每次都换版本 但是 如果我重
  • Tensorflow 导入错误:没有名为“tensorflow”的模块

    我在 Windows Python 3 5 Anaconda 环境中安装了 TensorFlow 验证成功 有警告 tensorflow C gt python Python 3 5 3 英特尔公司 默认 2017 年 4 月 27 日 1
  • 所见即所得与 Unicode

    我在 Delphi 中编写了一个 Windows 程序 该程序使用 GetCharWidth 和 Em Square 将文本非常精确地放置并换行到屏幕和打印机 这对于 ANSI 文本效果很好 您只需要检索和计算 255 个字符的宽度 但当您
  • 在多行上使用 vim 的 f 命令

    任何人都知道如何快速找到下一个出现的字符 如 f 命令 但多行 IE 快速跳转到文件中某个字符的下一个出现位置 这不是 的作用吗 如果您正在寻找下一个 x 请在命令模式下执行 x 然后你可以按 n 前进到下一个x 然后是下一个x 依此类推
  • 为什么我在 Windows 上使用 async 和 wait 时会收到 NotImplementedError 错误?

    我有这个代码 import os import time import asyncio async def run command args Example from http asyncio readthedocs io en lates
  • 获取自动热键中的可用屏幕区域

    我正在尝试编写一些简单的 AutoHotkey 脚本来移动窗口 但在获取正确的屏幕尺寸值时遇到问题 我试图获取屏幕上可用区域的大小 通常是全屏分辨率减去任务栏 也许还有任何其他停靠窗口 如 Vista 中的侧边栏 我发现的获取屏幕宽度的方法
  • 为什么 Windows 命令 DIR 在搜索 *.tif 文件时也会输出 *.tiff 文件?

    我想使用 Windows 命令DIR为了找到唯一TIF文件 即具有扩展名的文件 tif 因此我使用以下小批处理文件 for f delims a IN dir b a d s C wolter testversion input tif d
  • Vim 自动缩进换行

    我如何让vim将光标放在大括号内以新行开始 即用 表示光标位置 class 现在我的设置只能做到这一点 class 我在 vimrc 文件中得到了这个 设置自动缩进 shiftwidth 2 tabstop 2 noexpandtab 基本
  • npm package.json bin 无法在 Windows 上运行

    我正在尝试通过 package json 启动我的 cli 工具bin财产 我有以下内容 name mycli bin bin mycli 当我在包路径中打开 cmd 并输入 mycli 时 它表示该命令无法识别 我应该运行 npm 命令吗
  • C# 获取子窗口句柄

    我正在用 C 启动一个进程 然后使用 SendMessage 将 Windows 消息发送到该进程 通常我将消息发送到 Process MainWindowHandle 但在某些情况下 我可能需要找到子窗口句柄并向那里发送消息 我将如何在
  • 如果我使用客户端计算机上未安装的字体,会发生什么情况?

    有人可以告诉我 如果我在 WinForms 应用程序中使用目标计算机上不可用的字体 会发生什么情况 它是否使用同一系列的字体 只是 Sans Serif 还是其他字体 您的应用程序将回退到 Segoe UI Tahoma 然后是 MS Sa

随机推荐