使用 python 支持编译 vim - 安装 powerline

使用 python 支持编译 vim - 安装 powerline

我昨天花了一整天时间备份我的硬盘,全新安装 Mac OSX Yosemite,现在我正尝试将我的所有东西恢复到以前的样子。

我已经正确安装了 powerline(它显示在 tmux 中)但是当我打开 vim 时,我得到:

You need vim compiled with Python 2.6, 2.7 or 3.2 and later support for
Powerline to work...

我试过了:

brew uninstall python macvim
brew install python
brew install --override-system-vim macvim

以下是 的输出brew install python

==> Downloading https://homebrew.bintray.com/bottles/python-2.7.9.yosemite.bottle.10.tar.gz
Already downloaded: /Library/Caches/Homebrew/python-2.7.9.yosemite.bottle.10.tar.gz
==> Pouring python-2.7.9.yosemite.bottle.10.tar.gz
==> Caveats
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md

.app bundles were installed.
Run `brew linkapps python` to symlink these to /Applications.
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/2to3
==> /usr/local/Cellar/python/2.7.9/bin/python -s setup.py --no-user-cfg install --force --verbose --insta
==> /usr/local/Cellar/python/2.7.9/bin/python -s setup.py --no-user-cfg install --force --verbose --insta
==> Summary

答案1

由于这篇文章已经是几个月前发表的,我猜你已经自己解决了这个问题。对于其他不幸的人来说,这是我目前能想到的最好的办法。

我无法评论您询问的所有内容(电力线等),但作为 Mac/Vim 用户(我自己也是 Yosemite 新手),安装非常简单(或应该非常简单)。您可以使用以下方法获得可靠的入门版本:

在开始之前收集一些信息:

which vim
/usr/bin/vim

vim --version | egrep --color 'VIM|Compiled|python|ruby|perl|tcl'

您将看到这是 Apple 版本。接下来,安装 Vim

vim --override-system-vim --with-features=huge --disable-nls --enable-interp=lua,ruby,perl,python

--with-features=huge基本上提供了完整的安装。--override-system-vim之所以添加,是因为您在上面的示例中使用了它。我也这样做。OS X 上的 Vim 太丢脸了。

再次运行这些命令:

which vim
/usr/local/bin/vim

vim --version | egrep --color 'VIM|Compiled|python|ruby|perl|tcl'

输出应该会有明显变化。Vim 已加入/usr/local/bin/,但不是 Apple 构建的。您关心的所有内容旁边都应该有一个加号;例如: +ruby/dyn +python/dyn等。

附言:MacVim 的流行表明,它就是你应该使用。帮自己一个忙,放弃它,换成真品。

在真正的终端模拟器中使用 Vim;我只使用Terminal.appOS X 提供的。从非常简单的角度来看,可能没有明显的区别。但是,当您开始灵活使用 Vim 时,您会注意到巨大的回报。

我希望这有帮助 :-)

相关内容