mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-24 22:45:12 +02:00
Add extention to support yegappan/taglist
This commit is contained in:
parent
70904d7070
commit
d134ae8c2f
@ -249,6 +249,11 @@ function! airline#extensions#load()
|
|||||||
call airline#extensions#tagbar#init(s:ext)
|
call airline#extensions#tagbar#init(s:ext)
|
||||||
call add(s:loaded_ext, 'tagbar')
|
call add(s:loaded_ext, 'tagbar')
|
||||||
endif
|
endif
|
||||||
|
if get(g:, 'airline#extensions#taglist#enabled', 1)
|
||||||
|
\ && exists(':TlistShowTag')
|
||||||
|
call airline#extensions#taglist#init(s:ext)
|
||||||
|
call add(s:loaded_ext, 'taglist')
|
||||||
|
endif
|
||||||
|
|
||||||
if get(g:, 'airline#extensions#vista#enabled', 1)
|
if get(g:, 'airline#extensions#vista#enabled', 1)
|
||||||
\ && exists(':Vista')
|
\ && exists(':Vista')
|
||||||
|
29
autoload/airline/extensions/taglist.vim
Normal file
29
autoload/airline/extensions/taglist.vim
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
" MIT License. Copyright (c) 2021 DEMAREST Maxime (maxime@indelog.fr)
|
||||||
|
" Plugin: https://github.com/yegappan/taglist/
|
||||||
|
" vim: et ts=2 sts=2 sw=2
|
||||||
|
|
||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
if !exists(':TlistShowTag')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! airline#extensions#taglist#currenttag()
|
||||||
|
" Update tag list if taglist is not loaded (else we get an empty tag name)
|
||||||
|
let tlist_updated = v:false
|
||||||
|
if !exists('*Tlist_Get_Filenames()')
|
||||||
|
TlistUpdate
|
||||||
|
let tlist_updated = v:true
|
||||||
|
endif
|
||||||
|
if !tlist_updated
|
||||||
|
if stridx(Tlist_Get_Filenames(), expand('%:p')) < 0
|
||||||
|
TlistUpdate
|
||||||
|
let tlist_updated = v:true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return taglist#Tlist_Get_Tagname_By_Line()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! airline#extensions#taglist#init(ext)
|
||||||
|
call airline#parts#define_function('taglist', 'airline#extensions#taglist#currenttag')
|
||||||
|
endfunction
|
@ -186,7 +186,7 @@ function! airline#init#bootstrap()
|
|||||||
\ 'accent': 'bold'
|
\ 'accent': 'bold'
|
||||||
\ })
|
\ })
|
||||||
call airline#parts#define_empty(['obsession', 'tagbar', 'syntastic-warn',
|
call airline#parts#define_empty(['obsession', 'tagbar', 'syntastic-warn',
|
||||||
\ 'syntastic-err', 'eclim', 'whitespace','windowswap',
|
\ 'syntastic-err', 'eclim', 'whitespace','windowswap', 'taglist',
|
||||||
\ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count',
|
\ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count',
|
||||||
\ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count',
|
\ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count',
|
||||||
\ 'lsp_error_count', 'lsp_warning_count', 'scrollbar',
|
\ 'lsp_error_count', 'lsp_warning_count', 'scrollbar',
|
||||||
@ -229,7 +229,7 @@ function! airline#init#sections()
|
|||||||
let g:airline_section_gutter = airline#section#create(['%='])
|
let g:airline_section_gutter = airline#section#create(['%='])
|
||||||
endif
|
endif
|
||||||
if !exists('g:airline_section_x')
|
if !exists('g:airline_section_x')
|
||||||
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
|
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
|
||||||
endif
|
endif
|
||||||
if !exists('g:airline_section_y')
|
if !exists('g:airline_section_y')
|
||||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||||
|
@ -1420,6 +1420,12 @@ tagbar <https://github.com/majutsushi/tagbar>
|
|||||||
let g:airline#extensions#tagbar#searchmethod = 'nearest'
|
let g:airline#extensions#tagbar#searchmethod = 'nearest'
|
||||||
let g:airline#extensions#tagbar#searchmethod = 'scoped-stl'
|
let g:airline#extensions#tagbar#searchmethod = 'scoped-stl'
|
||||||
<
|
<
|
||||||
|
------------------------------------- *airline-taglist*
|
||||||
|
taglist <https://github.com/yegappan/taglist>
|
||||||
|
|
||||||
|
* enable/disable taglist integration >
|
||||||
|
let g:airline#extensions#taglist#enabled = 1
|
||||||
|
<
|
||||||
------------------------------------- *airline-tmuxline*
|
------------------------------------- *airline-tmuxline*
|
||||||
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user