Powerline在Vim中设置错误


9

我根据他们的安装建议使用pip install安装了电力线。我在zsh作为提示和tmux作为状态行都可以正常工作,但我无法在vim中正常工作。

当我将以下内容添加到我的vimrc中时:

python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup

我收到以下错误

Error detected while processing /home/jordan/.vimrc:
line    1:
E319: Sorry, the command is not available in this version: python from powerline.vim import setup as powerline_setup
line    2:
E319: Sorry, the command is not available in this version: python powerline_setup()
line    3:
E319: Sorry, the command is not available in this version: python del powerline_setup

编辑:检查完我的vim版本(vim.gnome)是使用python支持编译的,我注意到它是(python3)。因此,我按照安装说明将vimrc更改为使用python3,并获得以下信息:

Error detected while processing /home/jordan/.vimrc:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'powerline'
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined

任何想法,以我的智慧而告终!

解决的编辑:我无法使其与python3一起使用,但似乎这是vim.gnome和vim.basic支持的唯一python版本。

我安装了apt install vim-nox-py2带有python 2支持的vim.nox ,并且一切正常。希望这可以解决其他人的头痛问题。

Answers:


11

我将其修复如下:

  1. 编辑~/.vimrc和改变pythonpython3各在上述原来的问题的3条线的
  2. sudo apt-get install python3-pip
  3. pip3 install --user powerline-status
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.