1

我已经多次尝试按照此处概述的 Powerline 安装说明进行操作,但无论我做什么,这些状态栏都不会出现。

我在优胜美地并尝试使用Tmux为 Python 开发环境 安装Powerline for Vim 。

这是我的 ~/.vimrc 文件:

set nocompatible              " be iMproved, required
filetype off                  " required                                        

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

这是我的 ~/.tmux.conf 文件:

source '{repository_root}/powerline/bindings/tmux/powerline.conf'

我手动安装了字体(install.sh 脚本对我不起作用),您可以在此处获取。

我在 Tmux 中看到的只是标准的默认绿线,带有 bash、用户名和日期信息。我知道我可能在这里遗漏了一些明显的东西,但是对于我需要查看或修复的内容有什么建议吗?

4

2 回答 2

2

我建议你试试vim-airline 。它完全用 vimscript 编写,与 powerline 相比非常轻量级。没有 python 依赖,它很容易设置并且开箱即用。

它与tmuxlinepromptline等其他插件集成得非常好,

于 2015-09-02T18:10:20.347 回答
1

如果您不想尝试 ronkag 建议的尝试 vim-airline,请尝试以下操作以使 Powerline 在您的设置中正常工作:

1. 你的 ~/.vimrc 看起来有点滑稽,好像它可能缺少一些东西。这是我的参考:

set nocompatible              " be iMproved, required
filetype off                  " required                                        

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'


" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'

" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

source /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim
set laststatus=2         

if has("gui_running")
       let s:uname = system("uname")
          if s:uname == "Darwin\n"
                    set guifont=Inconsolata\ for\ Powerline:h15
                       endif
                   endif


set guifont=Inconsolata\ for\ Powerline:h15
let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8


"these are taken from fullstackpython.com

" enable syntax highlighting
syntax enable

" show line numbers
set number

" set tabs to have 4 spaces
set ts=4

" indent when moving to the next line while writing code
set autoindent

" expand tabs into spaces
set expandtab   

" when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4

" show a visual line under the cursor's current line 
set cursorline

" show the matching part of the pair for [] {} and ()
set showmatch

" enable all Python syntax highlighting features
let python_highlight_all = 1 

2. ~/.tmux.conf 文件中的内容看起来也不正确。您必须指定 powerline.conf 文件所在的实际文件路径。例如,我的看起来像这样:

source /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf

3. 假设您确实正确安装了字体包中的所有字体(您应该仔细检查,因为您是手动安装的),这可能很明显,但不要忘记在终端首选项中选择电力线字体!任何包含“for powerline”的字体都应该可以使用。

于 2015-09-02T18:17:11.560 回答