本文介绍了为什么我的vim命令行路径不同于我的shell路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如
$ echo $ PATH
/ usr / local / bin:/ usr / bin: bin:/ usr / sbin:/ sbin:/ usr / local / bin:/ bin:〜/ bin:/usr/local/Cellar/python3/3.2.3/bin
$ vim
:! echo $ PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/bin:/usr/local/Cellar/python3/3.2.3/bin
我希望他们是一样的。为什么它们不同?
如果它有区别,这里是我的shell,vim版本和操作系统版本:
$ echo $ SHELL
SHELL = / usr / local / bin / zsh
$ / usr / local / bin / zsh --version
zsh 5.0.0(x86_64-apple-darwin12.0.0)
$ vim --version
VIM - Vi IMproved 7.3(2010 Aug 15,compiled Jun 20 2012 13:16 :02)
由[email protected]编译
$ sw_vers
ProductName:Mac OS X
ProductVersion:10.8.2
BuildVersion:12C60
(Mountain Lion)
解决方案>
我无法使用zsh解决这个问题,最终为我的vim shell使用了bash。
这是我做的:
- 修改了我的.zshrc以使用bash
-
ln -s .zshrc .bashrc
- 已将
添加到我的.vimrc文件
现在我的vim命令行PATH等于我的zsh shell PATH。
e.g.,
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/bin:~/bin:/usr/local/Cellar/python3/3.2.3/bin
$ vim
:! echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/bin:/usr/local/Cellar/python3/3.2.3/bin
I expected them to be the same. Why are they different?
If it makes a difference, here is my shell, vim version and OS version:
$ echo $SHELL
SHELL=/usr/local/bin/zsh
$ /usr/local/bin/zsh --version
zsh 5.0.0 (x86_64-apple-darwin12.0.0)
$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 20 2012 13:16:02)
Compiled by [email protected]
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.8.2
BuildVersion: 12C60
(Mountain Lion)
解决方案
I was not able to resolve this with zsh, and ended up using bash for my vim shell.
Here's what I did:
- modified my .zshrc to work with bash
ln -s .zshrc .bashrc
- added
set shell=bash
to my .vimrc file
and now my vim command-line PATH is equal to my zsh shell PATH.
这篇关于为什么我的vim命令行路径不同于我的shell路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
08-23 08:12