vim - 电力线在 vim 中不起作用

标签 vim powerline vim-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

并在~/.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"

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

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

最佳答案

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

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

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

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

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

关于vim - 电力线在 vim 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47402481/

相关文章:

vim:如何在一个垂直分屏上设置taglist和nerdtree

vim - Vim:在文件中设置文件类型有效,但在.vimrc中不起作用-如何调试?

visual-studio-code - Visual Studio Code 中 ZSH 箭头颜色的问题

powerline - 如何禁用电力线符号?

vim - 添加天气小部件电力线

Vim Powerline 与 Syntastic 段

VIM 自定义箭头键映射不适用于窗口切换?

vim - 让 Vimwiki 与 SnipMate(vim 插件)一起工作