1
0
mirror of https://github.com/amix/vimrc synced 2025-07-01 12:45:00 +08:00

Updated plugins

This commit is contained in:
amix
2016-04-03 21:59:57 +01:00
parent 15bc8c1385
commit 4b45bb33c2
41 changed files with 322 additions and 5712 deletions

View File

@ -175,6 +175,10 @@ function! airline#check_mode(winnr)
call add(l:mode, 'crypt')
endif
if g:airline_detect_spell && &spell
call add(l:mode, 'spell')
endif
if &readonly || ! &modifiable
call add(l:mode, 'readonly')
endif

View File

@ -131,6 +131,10 @@ function! airline#extensions#tabline#title(n)
let title = TabooTabTitle(a:n)
endif
if empty(title) && exists('*gettabvar')
let title = gettabvar(a:n, 'title')
endif
if empty(title)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)

View File

@ -57,6 +57,11 @@ function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_t
endif
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
if has("tablineat")
let buf_name = '%'.buffer.index.'@airline#extensions#tabline#buffers#switchbuf@'.buf_name.'%X'
endif
call a:builder.add_section_spaced(group, buf_name)
endfor
endfunction
@ -83,7 +88,7 @@ function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pos)
endif
endif
call a:builder.add_section_spaced(group, tab.title.ctrlspace#api#TabBuffersNumber(tab.index))
call a:builder.add_section_spaced(group, '%'.tab.index.'T'.tab.title.ctrlspace#api#TabBuffersNumber(tab.index).'%T')
endfor
endfunction

View File

@ -18,6 +18,8 @@ let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
let s:c_like_langs = ['c', 'cpp', 'javascript', 'ld']
function! s:check_mixed_indent()
if s:indent_algo == 1
" [<tab>]<space><tab>
@ -35,8 +37,8 @@ function! s:check_mixed_indent()
endfunction
function! s:check_mixed_indent_file()
if stridx(&ft, 'c') == 0 || stridx(&ft, 'cpp') == 0 || stridx(&ft, 'javascript') == 0
" for C/CPP only allow /** */ comment style with one space before the '*'
if index(s:c_like_langs, &ft) > -1
" for C-like languages: allow /** */ comment style with one space before the '*'
let head_spc = '\v(^ +\*@!)'
else
let head_spc = '\v(^ +)'

View File

@ -15,7 +15,11 @@ function! airline#extensions#windowswap#init(ext)
endfunction
function! airline#extensions#windowswap#get_status()
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
" use new tab-aware api if WS is up to date
let s:mark = exists('*WindowSwap#IsCurrentWindowMarked') ?
\WindowSwap#IsCurrentWindowMarked() :
\(WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr())
if s:mark
return g:airline#extensions#windowswap#indicator_text.s:spc
endif
return ''

View File

@ -22,6 +22,7 @@ function! airline#init#bootstrap()
call s:check_defined('g:airline_detect_modified', 1)
call s:check_defined('g:airline_detect_paste', 1)
call s:check_defined('g:airline_detect_crypt', 1)
call s:check_defined('g:airline_detect_spell', 1)
call s:check_defined('g:airline_detect_iminsert', 0)
call s:check_defined('g:airline_inactive_collapse', 1)
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
@ -58,6 +59,7 @@ function! airline#init#bootstrap()
call s:check_defined('g:airline_symbols', {})
call extend(g:airline_symbols, {
\ 'paste': 'PASTE',
\ 'spell': 'SPELL',
\ 'readonly': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO',
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
\ 'linenr': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':',
@ -75,6 +77,7 @@ function! airline#init#bootstrap()
call airline#parts#define_function('iminsert', 'airline#parts#iminsert')
call airline#parts#define_function('paste', 'airline#parts#paste')
call airline#parts#define_function('crypt', 'airline#parts#crypt')
call airline#parts#define_function('spell', 'airline#parts#spell')
call airline#parts#define_function('filetype', 'airline#parts#filetype')
call airline#parts#define('readonly', {
\ 'function': 'airline#parts#readonly',
@ -102,7 +105,7 @@ endfunction
function! airline#init#sections()
let spc = g:airline_symbols.space
if !exists('g:airline_section_a')
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'capslock', 'iminsert'])
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'spell', 'capslock', 'iminsert'])
endif
if !exists('g:airline_section_b')
let g:airline_section_b = airline#section#create(['hunks', 'branch'])

View File

@ -62,6 +62,10 @@ function! airline#parts#paste()
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
endfunction
function! airline#parts#spell()
return g:airline_detect_spell && &spell ? g:airline_symbols.spell : ''
endfunction
function! airline#parts#iminsert()
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return toupper(b:keymap_name)