我希望在 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% 和环境变量也是如此。