折腾,重装 Mac 上的 VIM8

更新日期: 2017-11-09 阅读次数: 19201 分类: Vim

不确定是 Mac 系统升级,还是 homebrew 升级造成的,反正 VIM8 一直启动报错

Error detected while processing /Users/zhongwei/.vim/bundle/ultisnips/autoload/UltiSnips.vim:
line   15:
E887: Sorry, this command is disabled, the Python's site module could not be loaded.
Press ENTER or type command to continue

Error detected while processing function UltiSnips#TrackChange:
line    1:
E887: Sorry, this command is disabled, the Python's site module could not be loaded.

重新源码编译安装,依旧报错

UltiSnips requires py >= 2.7 or any py3

我的 Python 路径并没有问题。。。毫无头绪。。。

不得不通过

brew reinstall vim 

修复。

但是,安装后的 VIM 并不是默认的 VIM,需要覆盖旧的 VIM

find /usr -name vim
/usr/bin/vim
/usr/local/bin/vim
/usr/local/Cellar/vim
/usr/local/Cellar/vim/8.0.1200/bin/vim
/usr/local/Cellar/vim/8.0.1200/share/vim
/usr/local/go/misc/vim

➜  vim which vim
/opt/local/bin/vim
➜  vim sudo cp /usr/local/Cellar/vim/8.0.1200/bin/vim /opt/local/bin/vim

可以使用新的 VIM 了,但是启动报错

Error detected while processing /Users/zhongwei/.vimrc:
line   90:
E484: Can't open file /usr/local/share/vim/syntax/syntax.vim

通过如下方式修复

sudo ln -s /usr/local/Cellar/vim/8.0.1200/share/vim/vim80 /usr/local/share/vim

微信关注我哦 👍

大象工具微信公众号

我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式