mirror of
https://github.com/amix/vimrc
synced 2025-07-01 20:55:00 +08:00
Updated plugins
This commit is contained in:
@ -3,16 +3,31 @@
|
||||
This is the Changelog for the vim-airline project.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.8] - 2016-03-09
|
||||
- Changes
|
||||
- Themes have been moved into an extra repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
|
||||
- Many new themes
|
||||
- Airline Moved to new [repository](https://github.com/vim-airline/vim-airline)
|
||||
- New features
|
||||
- Integration with [taboo](https://github.com/gcmt/taboo.vim), [vim-ctrlspace](https://github.com/szw/vim-ctrlspace),
|
||||
[quickfixsigns](https://github.com/tomtom/quickfixsigns_vim), [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
|
||||
- Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
|
||||
- Improvements
|
||||
- Extensions
|
||||
- branch: support Git and Mercurial simultaneously, untracked files
|
||||
- whitespace: new mixed-indent rule
|
||||
- Windows support
|
||||
- Many bug fixes
|
||||
- Support for Neovim
|
||||
- Added wordcount extension
|
||||
- Adding Crypt and Byte Order Mark Indicator
|
||||
- New features
|
||||
- Many new themes
|
||||
- Extensions/integration
|
||||
- [taboo](https://github.com/gcmt/taboo.vim)
|
||||
- [vim-ctrlspace](https://github.com/szw/vim-ctrlspace)
|
||||
- [quickfixsigns](https://github.com/tomtom/quickfixsigns_vim)
|
||||
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
- [po.vim](http://www.vim.org/scripts/script.php?script_id=695)
|
||||
- [unicode.vim](https://github.com/chrisbra/unicode.vim)
|
||||
- wordcount
|
||||
- crypt indicator
|
||||
- byte order mark indicator
|
||||
- Tabline's tab mode can display splits simultaneously
|
||||
|
||||
## [0.7] - 2014-12-10
|
||||
- New features
|
||||
@ -94,7 +109,8 @@ This is the Changelog for the vim-airline project.
|
||||
- integration with other plugins: netrw, unite, nerdtree, undotree, gundo, tagbar, minibufexplr, ctrlp
|
||||
- support for themes: 8 included
|
||||
|
||||
[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.7...HEAD
|
||||
[Unreleased]: https://github.com/vim-airline/vim-airline/compare/v0.8...HEAD
|
||||
[0.8]: https://github.com/vim-airline/vim-airline/compare/v0.7...v0.8
|
||||
[0.7]: https://github.com/vim-airline/vim-airline/compare/v0.6...v0.7
|
||||
[0.6]: https://github.com/vim-airline/vim-airline/compare/v0.5...v0.6
|
||||
[0.5]: https://github.com/vim-airline/vim-airline/compare/v0.4...v0.5
|
||||
|
14
sources_non_forked/vim-airline/ISSUE_TEMPLATE.md
Normal file
14
sources_non_forked/vim-airline/ISSUE_TEMPLATE.md
Normal file
@ -0,0 +1,14 @@
|
||||
#### environment
|
||||
|
||||
- vim: ????
|
||||
- vim-airline: ????
|
||||
- OS: ????
|
||||
- terminal: ????
|
||||
|
||||
#### actual behavior
|
||||
|
||||
????
|
||||
|
||||
#### expected behavior
|
||||
|
||||
????
|
@ -72,9 +72,10 @@ endfunction
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
let existing = g:airline_theme
|
||||
let theme = substitute(g:colors_name, '-', '_', 'g')
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
let palette = g:airline#themes#{theme}#palette
|
||||
call airline#switch_theme(theme)
|
||||
return 1
|
||||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
|
@ -210,6 +210,10 @@ function! airline#extensions#load()
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#po#enabled', 1) && executable('msgfmt')
|
||||
call airline#extensions#po#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#wordcount#enabled', 1)
|
||||
call airline#extensions#wordcount#init(s:ext)
|
||||
endif
|
||||
|
@ -154,7 +154,7 @@ function! airline#extensions#branch#head()
|
||||
if exists("g:airline#extensions#branch#displayed_head_limit")
|
||||
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
|
||||
if len(b:airline_head) > w:displayed_head_limit - 1
|
||||
let b:airline_head = b:airline_head[0:w:displayed_head_limit - 1].'…'
|
||||
let b:airline_head = b:airline_head[0:(w:displayed_head_limit - 1)].(&encoding ==? 'utf-8' ? '…' : '.')
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#po#apply(...)
|
||||
if &ft ==# 'po'
|
||||
call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}')
|
||||
autocmd airline BufWritePost * unlet! b:airline_po_stats
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#stats()
|
||||
if exists('b:airline_po_stats') && !empty(b:airline_po_stats)
|
||||
return b:airline_po_stats
|
||||
endif
|
||||
|
||||
let airline_po_stats = system('msgfmt --statistics -o /dev/null -- '. expand('%:p'))
|
||||
if v:shell_error
|
||||
return ''
|
||||
endif
|
||||
try
|
||||
let b:airline_po_stats = '['. split(airline_po_stats, '\n')[0]. ']'
|
||||
catch
|
||||
let b:airline_po_stats = ''
|
||||
endtry
|
||||
if exists("g:airline#extensions#po#displayed_limit")
|
||||
let w:displayed_po_limit = g:airline#extensions#po#displayed_limit
|
||||
if len(b:airline_po_stats) > w:displayed_po_limit - 1
|
||||
let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 1)].(&encoding==?'utf-8' ? '…' : '.')
|
||||
endif
|
||||
endif
|
||||
return b:airline_po_stats
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#po#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#po#apply')
|
||||
endfunction
|
@ -5,6 +5,7 @@ let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
let s:ignore_bufadd_pat = get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree')
|
||||
|
||||
let s:taboo = get(g:, 'airline#extensions#taboo#enabled', 1) && get(g:, 'loaded_taboo', 0)
|
||||
if s:taboo
|
||||
let g:taboo_tabline = 0
|
||||
@ -41,27 +42,21 @@ function! s:toggle_on()
|
||||
endfunction
|
||||
|
||||
function! s:update_tabline()
|
||||
if get(g:, 'airline#extensions#tabline#disable_refresh', 0)
|
||||
return
|
||||
endif
|
||||
let match = expand('<afile>')
|
||||
if pumvisible()
|
||||
return
|
||||
elseif !get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
return
|
||||
" return, if buffer matches ignore pattern or is directory (netrw)
|
||||
elseif empty(match)
|
||||
elseif empty(match)
|
||||
\ || match(match, s:ignore_bufadd_pat) > -1
|
||||
\ || isdirectory(expand("<afile>"))
|
||||
return
|
||||
endif
|
||||
if empty(mapcheck("<Plug>AirlineTablineRefresh", 'n'))
|
||||
noremap <silent> <Plug>AirlineTablineRefresh :set mod!<cr>
|
||||
endif
|
||||
call feedkeys("\<Plug>AirlineTablineRefresh")
|
||||
call feedkeys("\<Plug>AirlineTablineRefresh")
|
||||
"call feedkeys(',,', 't')
|
||||
"call feedkeys(':unmap ,,')
|
||||
" force re-evaluation of tabline setting
|
||||
" disable explicit redraw, may cause E315
|
||||
"redraw
|
||||
doautocmd User BufMRUChange
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
@ -92,6 +87,7 @@ function! airline#extensions#tabline#load_theme(palette)
|
||||
|
||||
" Theme for tabs on the right
|
||||
let l:tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a)
|
||||
let l:tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c)
|
||||
let l:tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a)
|
||||
let l:tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
@ -100,6 +96,7 @@ function! airline#extensions#tabline#load_theme(palette)
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c)
|
||||
endif
|
||||
call airline#highlighter#exec('airline_tab_right', l:tab_right)
|
||||
call airline#highlighter#exec('airline_tabsel_right', l:tabsel_right)
|
||||
call airline#highlighter#exec('airline_tabmod_right', l:tabmod_right)
|
||||
call airline#highlighter#exec('airline_tabhid_right', l:tabhid_right)
|
||||
@ -163,3 +160,23 @@ function! airline#extensions#tabline#new_builder()
|
||||
|
||||
return airline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr)
|
||||
let cur = bufnr('%')
|
||||
if cur == a:bufnr
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(a:bufnr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(a:tab_bufs, a:bufnr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
return group
|
||||
endfunction
|
||||
|
@ -5,6 +5,7 @@ scriptencoding utf-8
|
||||
|
||||
let s:buffer_idx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
@ -64,23 +65,16 @@ function! airline#extensions#tabline#buffers#get()
|
||||
continue
|
||||
endif
|
||||
|
||||
if cur == nr
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
let group = airline#extensions#tabline#group_of_bufnr(tab_bufs, nr)
|
||||
|
||||
if nr == cur
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(tab_bufs, nr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Neovim feature: Have clickable buffers
|
||||
if has("tablineat")
|
||||
call b.add_raw('%'.nr.'@airline#extensions#tabline#buffers#switchbuf@')
|
||||
endif
|
||||
if s:buffer_idx_mode
|
||||
if len(s:number_map) > 0
|
||||
call b.add_section(group, s:spc . get(s:number_map, l:index, '') . '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)' . s:spc)
|
||||
@ -91,13 +85,16 @@ function! airline#extensions#tabline#buffers#get()
|
||||
else
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endif
|
||||
if has("tablineat")
|
||||
call b.add_raw('%X')
|
||||
endif
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
call b.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur
|
||||
@ -198,3 +195,11 @@ function s:map_keys()
|
||||
noremap <silent> <Plug>AirlineSelectNextTab :<C-u>call <SID>jump_to_tab(v:count1)<CR>
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function airline#extensions#tabline#buffers#switchbuf(minwid, clicks, button, modifiers) abort
|
||||
" Run the following code only on a single left mouse button click without modifiers pressed
|
||||
" works only in recent NeoVim with has('tablineat')
|
||||
if a:clicks == 1 && a:button is# 'l' && a:modifiers !~# '[^ ]'
|
||||
sil execute 'buffer' a:minwid
|
||||
endif
|
||||
endfunction
|
||||
|
@ -7,6 +7,12 @@ let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_tabline = ''
|
||||
|
||||
let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffers')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:switch_buffers_and_tabs = get(g:, 'airline#extensions#tabline#switch_buffers_and_tabs', 0)
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#off()
|
||||
augroup airline_tabline_ctrlspace
|
||||
autocmd!
|
||||
@ -25,6 +31,62 @@ function! airline#extensions#tabline#ctrlspace#invalidate()
|
||||
let s:current_tabnr = -1
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
let s:buffer_list = ctrlspace#api#BufferList(a:cur_tab)
|
||||
for buffer in s:buffer_list
|
||||
if a:cur_buf == buffer.index
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
elseif buffer.visible
|
||||
let group = 'airline_tab'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
|
||||
call a:builder.add_section_spaced(group, buf_name)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#add_tab_section(builder, pos)
|
||||
if a:pos == 0
|
||||
let pos_extension = ''
|
||||
else
|
||||
let pos_extension = '_right'
|
||||
endif
|
||||
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabsel'.pos_extension
|
||||
endif
|
||||
else
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod_unsel'.pos_extension
|
||||
else
|
||||
let group = 'airline_tabhid'.pos_extension
|
||||
endif
|
||||
endif
|
||||
|
||||
call a:builder.add_section_spaced(group, tab.title.ctrlspace#api#TabBuffersNumber(tab.index))
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#get()
|
||||
let cur_buf = bufnr('%')
|
||||
|
||||
@ -39,59 +101,44 @@ function! airline#extensions#tabline#ctrlspace#get()
|
||||
return s:current_tabline
|
||||
endif
|
||||
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
let builder = airline#extensions#tabline#new_builder()
|
||||
|
||||
call b.add_section_spaced('airline_tabtype', 'buffers')
|
||||
|
||||
let s:buffer_list = ctrlspace#api#BufferList(cur_tab)
|
||||
for buffer in s:buffer_list
|
||||
if cur_buf == buffer.index
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
else
|
||||
if buffer.modified
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif buffer.visible
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
|
||||
let buf_name = '%(%{airline#extensions#tabline#get_buffer_name('.buffer.index.')}%)'
|
||||
call b.add_section_spaced(group, buf_name)
|
||||
endfor
|
||||
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
for tab in s:tab_list
|
||||
if tab.current
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod_right'
|
||||
else
|
||||
let group = 'airline_tabsel_right'
|
||||
endif
|
||||
" Add left tabline content
|
||||
if s:show_buffers == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
elseif s:show_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
if tab.modified
|
||||
let group = 'airline_tabmod_unsel_right'
|
||||
else
|
||||
let group = 'airline_tabhid_right'
|
||||
endif
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
endif
|
||||
endif
|
||||
|
||||
call b.add_section_spaced(group, tab.title.ctrlspace#api#TabBuffersNumber(tab.index))
|
||||
endfor
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
call builder.split()
|
||||
call builder.add_section('airline_tabfill', '')
|
||||
|
||||
call b.add_section_spaced('airline_tabtype', 'tabs')
|
||||
" Add right tabline content
|
||||
if s:show_buffers == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
elseif s:show_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
else
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 1)
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:current_bufnr = cur_buf
|
||||
let s:current_tabnr = cur_tab
|
||||
let s:current_tabline = b.build()
|
||||
let s:current_tabline = builder.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
@ -1,11 +1,14 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:show_splits = get(g:, 'airline#extensions#tabline#show_splits', 1)
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
@ -39,19 +42,20 @@ function! airline#extensions#tabline#tabs#get()
|
||||
endif
|
||||
|
||||
let b = airline#extensions#tabline#new_builder()
|
||||
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == curtab
|
||||
let group = 'airline_tabsel'
|
||||
let group = 'airline_tabsel_right'
|
||||
if g:airline_detect_modified
|
||||
for bi in tabpagebuflist(i)
|
||||
if getbufvar(bi, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
let group = 'airline_tabmod_right'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
let s:current_modified = (group == 'airline_tabmod_right') ? 1 : 0
|
||||
else
|
||||
let group = 'airline_tab'
|
||||
let group = 'airline_tab_right'
|
||||
endif
|
||||
let val = '%('
|
||||
if s:show_tab_nr
|
||||
@ -66,14 +70,22 @@ function! airline#extensions#tabline#tabs#get()
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
|
||||
call b.add_raw('%T')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
|
||||
if s:show_close_button
|
||||
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
|
||||
call b.add_section('airline_tab_right', ' %999X'.s:close_symbol.' ')
|
||||
endif
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' tabs ')
|
||||
|
||||
if s:show_splits == 1
|
||||
let buffers = tabpagebuflist(curtab)
|
||||
for nr in buffers
|
||||
let group = airline#extensions#tabline#group_of_bufnr(buffers, nr)
|
||||
call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)')
|
||||
endfor
|
||||
elseif s:show_tab_type == 1
|
||||
call b.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
endif
|
||||
|
||||
let s:current_bufnr = curbuf
|
||||
|
@ -35,8 +35,14 @@ 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 '*'
|
||||
let head_spc = '\v(^ +\*@!)'
|
||||
else
|
||||
let head_spc = '\v(^ +)'
|
||||
endif
|
||||
let indent_tabs = search('\v(^\t+)', 'nw')
|
||||
let indent_spc = search('\v(^ +)', 'nw')
|
||||
let indent_spc = search(head_spc, 'nw')
|
||||
if indent_tabs > 0 && indent_spc > 0
|
||||
return printf("%d:%d", indent_tabs, indent_spc)
|
||||
else
|
||||
|
@ -47,13 +47,12 @@ function! airline#init#bootstrap()
|
||||
|
||||
call s:check_defined('g:airline_theme_map', {})
|
||||
call extend(g:airline_theme_map, {
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'bubblegum': 'bubblegum',
|
||||
\ '\CTomorrow': 'tomorrow',
|
||||
\ 'base16': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ 'wombat': 'wombat',
|
||||
\ 'zenburn': 'zenburn',
|
||||
\ 'solarized': 'solarized',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
|
@ -70,7 +70,11 @@ function! airline#parts#iminsert()
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
if &readonly && &modifiable && !filereadable(bufname('%'))
|
||||
return '[noperm]'
|
||||
else
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
|
@ -489,13 +489,22 @@ eclim <https://eclim.org>
|
||||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
* enable/disable enhanced tabline. >
|
||||
Note: If you're using the ctrlspace tabline only the option marked with (c)
|
||||
are supported!
|
||||
|
||||
* enable/disable enhanced tabline. (c)
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
|
||||
* enable/disable displaying open splits per tab (only when tabs are opened). >
|
||||
let g:airline#extensions#tabline#show_splits = 1
|
||||
*
|
||||
* switch position of buffers and tabs on splited tabline (c)
|
||||
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
|
||||
|
||||
* enable/disable displaying buffers with a single tab. (c)
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
* enable/disable displaying tabs, regardless of number. >
|
||||
* enable/disable displaying tabs, regardless of number. (c)
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
@ -515,11 +524,13 @@ eclim <https://eclim.org>
|
||||
* enable/disable displaying tab type (far right) >
|
||||
let g:airline#extensions#tabline#show_tab_type = 1
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
* rename label for buffers (default: 'buffers') (c)
|
||||
let g:airline#extensions#tabline#buffers_label = 'b'
|
||||
|
||||
Note: If you're using ctrlspace the tabline shows your tabs on the right and
|
||||
buffer on the left. Also none of the tabline switches is currently
|
||||
supported!
|
||||
* rename label for tabs (default: 'tabs') (c)
|
||||
let g:airline#extensions#tabline#tabs_label = 't'
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
@ -545,7 +556,7 @@ eclim <https://eclim.org>
|
||||
Use |gt| for switching tabs.
|
||||
In tabmode, those mappings will switch to the specified tab.
|
||||
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
* defines the name of a formatter for how buffer names are displayed. (c)
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
@ -565,7 +576,7 @@ eclim <https://eclim.org>
|
||||
* configure whether buffer numbers should be shown. >
|
||||
let g:airline#extensions#tabline#buffer_nr_show = 0
|
||||
<
|
||||
* configure how buffer numbers should be formatted with |printf|. >
|
||||
* configure how buffer numbers should be formatted with |printf()|. >
|
||||
let g:airline#extensions#tabline#buffer_nr_format = '%s: '
|
||||
<
|
||||
* configure the formatting of filenames (see |filename-modifiers|). >
|
||||
@ -614,9 +625,13 @@ eclim <https://eclim.org>
|
||||
let airline#extensions#tabline#ignore_bufadd_pat =
|
||||
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree'
|
||||
|
||||
<
|
||||
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
|
||||
|
||||
* enable Refresh of tabline buffers on |BufAdd| autocommands
|
||||
(set this to one, if you note 'AirlineTablineRefresh', however, this
|
||||
won't update airline on |:badd| commands) >
|
||||
let airline#extensions#tabline#disable_refresh = 0
|
||||
|
||||
------------------------------------- *airline-tmuxline*
|
||||
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
||||
|
||||
@ -707,6 +722,15 @@ Shows number of errors and warnings in the current file detected by YCM.
|
||||
* set warning count prefix >
|
||||
let g:airline#extensions#ycm#warning_symbol = 'W:'
|
||||
<
|
||||
------------------------------------- *airline-po*
|
||||
po.vim <http://www.vim.org/scripts/script.php?script_id=2530>
|
||||
|
||||
* enable/disable po integration >
|
||||
let g:airline#extensions#po#enabled = 1
|
||||
<
|
||||
* truncate width names to a fixed length >
|
||||
let g:airline#extensions#po#displayed_limit = 0
|
||||
<
|
||||
==============================================================================
|
||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||
|
||||
|
Reference in New Issue
Block a user