mirror of
https://github.com/amix/vimrc
synced 2025-06-30 11:54:59 +08:00
Updated vim plugins. Nerd tree is on the right by default
This commit is contained in:
@ -118,6 +118,7 @@ This plugin follows the standard runtime path structure, and as such it can be i
|
||||
|
||||
* [Pathogen][11]
|
||||
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
|
||||
* Remember to run `:Helptags` to generate help tags
|
||||
* [NeoBundle][12]
|
||||
* `NeoBundle 'bling/vim-airline'`
|
||||
* [Vundle][13]
|
||||
|
@ -59,19 +59,22 @@ function! s:toggle_on()
|
||||
let [ s:original_tabline, s:original_showtabline ] = [ &tabline, &showtabline ]
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
set showtabline=2
|
||||
else
|
||||
augroup airline_tabline
|
||||
autocmd!
|
||||
augroup airline_tabline
|
||||
autocmd!
|
||||
" Invalidate cache.
|
||||
autocmd BufAdd,BufUnload * unlet! s:current_buffer_list
|
||||
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
set showtabline=2
|
||||
else
|
||||
if s:show_buffers == 1
|
||||
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(s:get_buffer_list()))
|
||||
autocmd BufUnload * call <sid>show_tabline(s:buf_min_count, len(s:get_buffer_list()) - 1)
|
||||
else
|
||||
autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
|
||||
endif
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
@ -130,10 +133,14 @@ function! airline#extensions#tabline#title(n)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get_buffer_name(nr)
|
||||
return airline#extensions#tabline#{s:formatter}#format(a:nr, get(s:, 'current_buffer_list', s:get_buffer_list()))
|
||||
return airline#extensions#tabline#{s:formatter}#format(a:nr, s:get_buffer_list())
|
||||
endfunction
|
||||
|
||||
function! s:get_buffer_list()
|
||||
if exists('s:current_buffer_list')
|
||||
return s:current_buffer_list
|
||||
endif
|
||||
|
||||
let buffers = []
|
||||
let cur = bufnr('%')
|
||||
for nr in range(1, bufnr('$'))
|
||||
|
Reference in New Issue
Block a user