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



我已经多次尝试按照这里列出的Powerline安装说明进行安装,但无论我怎么做,这些状态栏就是不出现。

我在Yosemite,并试图安装Powerline for 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脚本不适合我),您可以在这里获得。

我在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 == "Darwinn"
                    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"字样的字体都可以。

Python 2.7不存在于较新版本的OSX中,所以我不得不使用Python3安装电力线,如下所示(注意我使用的是pip3而不是pip):

brew install python
pip3 install powerline-status
上面的第一个命令为我安装了Python 3.10。我已经有了Python 3.9,所以我认为第一行不需要了。

/Users/{replace_your_user_name}/Library/Python/3.10/lib/python/site-packages/powerline/bindings/下安装的电力线绑定

.tmux.conf中我添加了这一行:

source '/Users/{replace_your_user_name}/Library/Python/3.10/lib/python/site-packages/powerline/bindings/tmux/powerline.conf'

这没有工作,直到我添加文件夹包含powerline-configPATH。在我把这个添加到我的.zshrc

之后,一切都工作了
export PATH=$PATH:/Users/{replace_your_user_name}/Library/Python/3.10/bin

相关内容

  • 没有找到相关文章

最新更新