如何使 Windows 上的 gvim 表现得与 linux 控制台 vim 完全一样?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2093578/
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 13:47:07  来源:igfitidea点击:

How to make gvim on Windows behave exactly like linux console vim?

windowsvim

提问by SWilk

I have used Vim extensively on linux console, I am used to it's keyboard shortcuts, like Ctrl+Vfor vertical selection, and many others.

我在 linux 控制台上广泛使用 Vim,我已经习惯了它的键盘快捷键,例如用于垂直选择的Ctrl+V等等。

I have installed gVim for Windows on my computer at work, and I almost can't use it, as many of keyboard commands were redefined. The Ctrl+Vpastes the text from clipboard instead of starting vertical selection for example...

我在工作的电脑上安装了gVim for Windows,几乎无法使用它,因为许多键盘命令都被重新定义了。该Ctrl+V粘贴剪贴板,而不是首发例如垂直选择的文字...

How make gVim work exactly like the default linux console version,possibly with the default gentoo settings?

如何让 gVim 像默认的 linux 控制台版本一样工作,可能使用默认的 gentoo 设置?

采纳答案by Yin Zhu

in c:\program files\vim\_vimrc:

c:\program files\vim\_vimrc

" source $VIMRUNTIME/mswin.vim
" behave mswin

Comment out these two lines

注释掉这两行

回答by Paul Tomblin

Issue the following commands:

发出以下命令:

set compatible
:mkvimrc!

That will write out a _vimrc that overrules the one in \Program Files\vim

这将写出一个 _vimrc 来推翻 \Program Files\vim 中的那个

回答by Paul Tomblin

Edit your .vimrc file so that it contains only the line:

编辑您的 .vimrc 文件,使其仅包含以下行:

set compatible