gvim读取_vimrc,vim没有

时间:2021-05-20 16:50:08

I'm running vim from an external hard drive, so _vimrc is not in %HOMEPATH% the way it normally is.

我正在从外部硬盘驱动器运行vim,因此_vimrc不像通常那样处于%HOMEPATH%。

_vimrc is inside the vim folder, in addition to the vim73 and vimfiles folders.

除了vim73和vimfiles文件夹之外,_vimrc还在vim文件夹中。

_vimrc works when I run gvim, but not when I run vim.

_vimrc在我运行gvim时有效,但在运行vim时却没有。

Why?

为什么?

2 个解决方案

#1


1  

If you are using MSYS or Cygwin, these programs will cause vim to look for your _vimrc in their own home directories, not the typical Windows home directory.

如果您使用的是MSYS或Cygwin,这些程序将导致vim在自己的主目录中查找_vimrc,而不是典型的Windows主目录。

If this is the case, you can probably fix it by making a link to your _vimrc and placing it in their special home directory.

如果是这种情况,您可以通过链接到_vimrc并将其放在特殊的主目录中来修复它。

#2


0  

Seems you are using vim on Windows, if you are using vim binary release with GVIM, it should work without problem, just confirm it by checking your path command "path", and make sure you had installed vim with command line script, it's a option during installation.

似乎你在Windows上使用vim,如果你正在使用带有GVIM的vim二进制版本,它应该没有问题,只需通过检查你的路径命令“path”来确认它,并确保你已经用命令行脚本安装了vim,它是一个安装期间的选项。

If you are using MSYS or Cygwin, just type "type vim" to see which vim binary you are using, and check your home by 'cd ~', it should use the rc file under ~ unless you had some customization with previous binary/shell script.

如果您正在使用MSYS或Cygwin,只需键入“type vim”以查看您正在使用的vim二进制文件,并通过'cd~'检查您的家,它应该使用〜下的rc文件,除非您使用以前的二进制文件进行了一些自定义/ shell脚本。

#1


1  

If you are using MSYS or Cygwin, these programs will cause vim to look for your _vimrc in their own home directories, not the typical Windows home directory.

如果您使用的是MSYS或Cygwin,这些程序将导致vim在自己的主目录中查找_vimrc,而不是典型的Windows主目录。

If this is the case, you can probably fix it by making a link to your _vimrc and placing it in their special home directory.

如果是这种情况,您可以通过链接到_vimrc并将其放在特殊的主目录中来修复它。

#2


0  

Seems you are using vim on Windows, if you are using vim binary release with GVIM, it should work without problem, just confirm it by checking your path command "path", and make sure you had installed vim with command line script, it's a option during installation.

似乎你在Windows上使用vim,如果你正在使用带有GVIM的vim二进制版本,它应该没有问题,只需通过检查你的路径命令“path”来确认它,并确保你已经用命令行脚本安装了vim,它是一个安装期间的选项。

If you are using MSYS or Cygwin, just type "type vim" to see which vim binary you are using, and check your home by 'cd ~', it should use the rc file under ~ unless you had some customization with previous binary/shell script.

如果您正在使用MSYS或Cygwin,只需键入“type vim”以查看您正在使用的vim二进制文件,并通过'cd~'检查您的家,它应该使用〜下的rc文件,除非您使用以前的二进制文件进行了一些自定义/ shell脚本。