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

Powerline Installation Issues for Vim/Tmux on Mac OSX 10.10.5

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

我正在 Yosemite 并尝试为 Python 开发环境安装 Powerline for Vim with Tmux

这是我的 ~/.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、用户名和日期信息的标准默认绿线。我知道我可能在这里遗漏了一些明显的东西,但是对于我需要查看或修复的内容有什么建议吗?

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

它与 tmuxline, promptline

等其他插件的集成非常好

如果您不想尝试 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。假设你确实正确安装了字体包中的所有字体(你应该仔细检查,因为你是手动安装的),这可能是一个明显的,但不要忘记 select 终端首选项中的电力线字体!任何包含 "for powerline" 的字体都应该可以使用。