Windows 上 gVim 中的可视模式不像在 Unix 中那样工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5960039/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:49:55  来源:igfitidea点击:

Visual mode in gVim on Windows doesn't work the way as it works in Unix

windowsvim

提问by sundar

I'm using gVim version 7.3 on my Windows. When using gVim in my Unix, to insert a common text at the beginning of each line in a file, I do the following steps:

我在 Windows 上使用 gVim 7.3 版。在我的 Unix 中使用 gVim 时,要在文件的每一行的开头插入一个公共文本,我执行以下步骤:

  1. Enter visual mode (CTRL+V).
  2. Select the lines for which the text has to be inserted at the beginning using arrow keys or hjkl keys.
  3. After selection press Shift+I.
  4. The cursor goes to the begin of the line where I started. I enter some text and press ESC key.
  5. Now the entire block of lines has the text inserted at the beginning.
  1. 进入可视模式 (CTRL+V)。
  2. 使用箭头键或 hjkl 键选择必须在开头插入文本的行。
  3. 选择后按Shift+I。
  4. 光标移到我开始的行的开头。我输入一些文本并按 ESC 键。
  5. 现在整个行块都在开头插入了文本。

So here's my question. How do I do the same thing in my gVim on Windows? It's not working if I follow the above as on Unix. Could someone please help me out with this?

所以这是我的问题。我如何在 Windows 上的 gVim 中做同样的事情?如果我在 Unix 上遵循上述内容,则它不起作用。有人可以帮我解决这个问题吗?

回答by Prince Goulash

If you have behave mswinin your vimrc then some of the Vim mappings are modified to be more "Windows-like". In particular you will need to use <CTRL-Q>to enter block-visual mode.

如果您behave mswin的 vimrc 中有,那么一些 Vim 映射将被修改为更“类似 Windows”。特别是您将需要使用<CTRL-Q>进入块可视模式。

I have behave xtermin my Windows vimrc which eliminates these issues.

behave xterm在我的Windows的vimrc消除这些问题。