Vim Powerline 仅在 2 个缓冲区打开时才工作

Vim Powerline 仅在 2 个缓冲区打开时才工作

我遇到了一些麻烦Vim 电力线插入。我已经安装了它,但只有当我打开两个缓冲区时它才起作用。下面是从视觉上描述问题的图片以及我的.vimrc。我是否配置错误?


单缓冲器

不使用一个缓冲区

两个缓冲区

使用两个缓冲区

.vimrc内容

" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
  set mouse=a
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent on

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  " Also don't do it when the mark is in the first line, that is the default
  " position when opening a file.
  autocmd BufReadPost *
    \ if line("'\"") > 1 && line("'\"") <= line("$") |
    \   exe "normal! g`\"" |
    \ endif

  augroup END

else

  set autoindent        " always set autoindenting on

endif " has("autocmd")

" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
  command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
          \ | wincmd p | diffthis
endif

if has('langmap') && exists('+langnoremap')
  " Prevent that the langmap option applies to characters that result from a
  " mapping.  If unset (default), this may break plugins (but it's backward
  " compatible).
  set langnoremap
endif

" Set tab width stuff
set tabstop=4 softtabstop=0 noexpandtab shiftwidth=4

" Set to use spaces in git commits
autocmd FileType gitcommit setlocal tabstop=4 softtabstop=0 expandtab shiftwidth=4

" Show invisibles
set list

" Set invisibles
set lcs=eol:$,tab:»·,trail:×,extends:…,precedes:…

" Solarized colors
syntax enable
set background=dark
colorscheme solarized

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

对于它的价值,我正在使用巴本(带有一些附加功能的 Cygwin)在 Windows 7 上。

答案1

我了解到 Vim 不显示单个窗口的状态行,只有当两个窗口打开时才会显示。这可以通过包含set laststatus=2在您的 中来覆盖.vimrc,这使得状态始终显示。

相关内容