我想使用virtualenv的python来使用:!python % <Enter>
执行当前缓冲区。但是,MacVim使用系统python而不是virtualenv的python。
我已实施this answer,但:!python %<Enter>
仍然无法正常运作。这是我的意思的一个例子 - 这些命令激活了virtualenv(用virtualenvwrapper管理,这很重要)
which python
- &gt;
/Users/myuser/.virtualenvs/MyVirtualEnv/bin/python
- &gt;行:python import sys; print sys.executable<Enter>
- &gt;
/Users/myuser/.virtualenvs/MyVirtualEnv/bin/python
- &gt;行:!which python<Enter>
- &gt; /usr/bin/python
- &gt;不行。由于最后一个与我执行缓冲区的方式最相似,你能否解释一下如何使用现有的virtualenv的python在MacVim中实现:!python %<Enter>
?
编辑:另外,我有这个别名来使用命令行MacVim:
alias vim=/usr/local/Cellar/macvim/7.3-66/MacVim.app/Contents/MacOS/Vim
此外,这是MacVim中:echo $PATH<Enter>
的输出:
:echo $PATH<Center>
/Users/myuser/.virtualenvs/MyVirtualEnv/bin:/Users/myuser/.virtualenvs/MyVirtualEnv/bin:/Users/myuser/.virtualenvs/MyVirtualEnv/bin:/Users/myuser/.rbenv/shims:/Users/myuser/.rbenv/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/myuser/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/java/bin:/usr/lib64/kde4/libexec:/opt/kde3/lib64/qt3/bin:/opt/kde3/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.:/usr/local/Cellar/go/1.0.3/bin