电力线在 vim 中不起作用

mCs*_*mCs 3 vim vim-powerline powerline

Ubuntu 16.04 已安装sudo apt-get install powerline并添加到 .bashrc:

# Powerline
if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
        source /usr/share/powerline/bindings/bash/powerline.sh
fi
Run Code Online (Sandbox Code Playgroud)

并在~/.vimrc

" Powerline
set rtp+=/usr/share/powerline/bindings/vim/

" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256  colours)
set t_Co=256
let g:Powerline_symbols = "fancy"
Run Code Online (Sandbox Code Playgroud)

再次运行时,例如。vim ~/.vimrc这里没有电力线良好状态:https : //www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-4.png

我该如何解决这个问题才能在底部获得这条花哨的线条?

Gre*_*tin 5

只是没有人在这里浪费时间(就像我一样)。如果您像 OP 一样从发行版的 repo(如 apt-get)安装,那么只需在您的现有行上方添加以下 3 行/etc/vim/vimrc

python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
Run Code Online (Sandbox Code Playgroud)

如果您使用 Python3,请将其设为“python3”。

我发现这是电力线文档的来源。但是,这些说明是针对从 pip 安装的(但在这里也可以使用,因为无论如何它都只是 python)。

https://powerline.readthedocs.io/en/latest/usage/other.html#vim-statusline