Mac OSX 10.10.5上Vim / Tmux的电力线安装问题

时间:2015-09-02 17:58:47

标签: python macos vim tmux powerline

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

我正在使用Yosemite并尝试为Powerline安装Vim Tmux用于Python开发环境。

这是我的〜/ .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脚本对我来说不起作用),你可以得到here

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

2 个答案:

答案 0 :(得分:2)

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

它与tmuxlinepromptline

等其他插件完美集成

答案 1 :(得分: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”的字体都可以使用。