[英]How to stop vim from defaulting to older version?
I have the latest version of vim installed in my home dir (I'm a user on a shared environment), with all my customizations and stuff. 我在我的家庭目录中安装了最新版本的vim(我是共享环境中的用户),具有我的所有自定义和内容。 I've set alias vim=$HOME/path_to_vim_dir
, in my .zshrc
file. 我在.zshrc
文件中设置了alias vim=$HOME/path_to_vim_dir
。 I've also set EDITOR=vim
, SVN_EDITOR=vim
. 我还设置了EDITOR=vim
, SVN_EDITOR=vim
。 However, anytime I do a commit operation without -m "..."
in either git or svn, or even when editing crontab
, the version of vim that opens up is an old version somewhere in /usr/share/
... how do I stop this and get vim (no matter which program calls it) to default to my version? 但是,无论何时我在git或svn中执行没有-m "..."
的提交操作,或者甚至在编辑crontab
,打开的vim版本都是/usr/share/
的旧版本...我停止这个并获得vim(无论哪个程序调用它)默认为我的版本? I've also tried setting EDITOR=$HOME/path_to_vim_dir/bin/vim
, but that has no effect either. 我也尝试过设置EDITOR=$HOME/path_to_vim_dir/bin/vim
,但这也没有效果。
确保您的vim位置在$ PATH上,位于系统范围内安装的位置之前。
Not sure about zsh, but I know in bash you have to export the variables EDITOR
or SVN_EDITOR
. 不确定zsh,但我知道在bash中你必须导出变量EDITOR
或SVN_EDITOR
。 Simply setting them doesn't do the trick. 简单地设置它们并不成功。
Also, set it to the absolute path of the binary (path_to_your_home/path_to_vim_dir/vim). 另外,将其设置为二进制文件的绝对路径(path_to_your_home / path_to_vim_dir / vim)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.