我很高兴使用 Powerline对于 Vim 有一段时间了,直到今天 Homebrew 安装了从 3.6.5 到 3.7.0 的 Python 升级。从那以后,Powerline 在 Vim 中停止正常工作。

首先,在启动 Vim 时,有一个错误说 powerline找不到模块,我想这是有道理的,如果 pip为每个 Python 次要版本安装包。

所以我安装了powerline-status使用 pip 再次打包作为 described in the docs :

pip install powerline-status 

现在, ModuleNotFoundError不见了,我在 Vim 中得到了一条工作电源线, 但是 每次我启动 Vim 时,我都会收到另一个错误消息:
/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses 
Press ENTER or type command to continue 

而且我必须按 Enter 或任何其他键才能继续,这很烦人。

如果我从我的 .vimrc 中删除以下用于加载电力线的命令(如 described in the docs) , DeprecationWarning不见了,但显然电力线也不见了......
python3 from powerline.vim import setup as powerline_setup 
python3 powerline_setup() 
python3 del powerline_setup 

searched their GitHub issues ,但找不到任何相关内容。

有谁知道这个的解决方案?

请您参考如下方法:

由于错误状态,imp 模块已被弃用。
作为一种解决方法,将您放入 .vimrc 的命令更改为以下内容:

silent! python3 from powerline.vim import setup as powerline_setup 
python3 powerline_setup() 
python3 del powerline_setup 

沉默的!关键字将抑制错误消息。

Source


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!