mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 20:24:27 +08:00
Add gen_tags.vim plugin support
Display a "Gen. gen_tags" text in section x when gen_tags is generating tags, similar to gutentags support.
This commit is contained in:
@@ -408,6 +408,11 @@ function! airline#extensions#load()
|
||||
call add(s:loaded_ext, 'gutentags')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#gen_tags#enabled', 1) && (get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0))
|
||||
call airline#extensions#gen_tags#init(s:ext)
|
||||
call add(s:loaded_ext, 'gen_tags')
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#grepper#enabled', 1) && get(g:, 'loaded_grepper', 0))
|
||||
call airline#extensions#grepper#init(s:ext)
|
||||
call add(s:loaded_ext, 'grepper')
|
||||
|
||||
19
autoload/airline/extensions/gen_tags.vim
Normal file
19
autoload/airline/extensions/gen_tags.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
|
||||
" Written by Kamil Cukrowski 2020
|
||||
" Plugin: https://github.com/jsfaint/gen_tags.vim
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !(get(g:, 'loaded_gentags#gtags', 0) || !get(g:, 'loaded_gentags#ctags', 0))
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#gen_tags#status(...) abort
|
||||
return gen_tags#job#is_running() != 0 ? 'Gen. gen_tags' : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#gen_tags#init(ext) abort
|
||||
call airline#parts#define_function('gen_tags', 'airline#extensions#gen_tags#status')
|
||||
endfunction
|
||||
|
||||
@@ -176,6 +176,7 @@ function! airline#init#bootstrap()
|
||||
call airline#parts#define_text('bookmark', '')
|
||||
call airline#parts#define_text('capslock', '')
|
||||
call airline#parts#define_text('gutentags', '')
|
||||
call airline#parts#define_text('gen_tags', '')
|
||||
call airline#parts#define_text('grepper', '')
|
||||
call airline#parts#define_text('xkblayout', '')
|
||||
call airline#parts#define_text('keymap', '')
|
||||
@@ -211,7 +212,7 @@ function! airline#init#sections()
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
endif
|
||||
if !exists('g:airline_section_x')
|
||||
let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'vista', 'gutentags', 'omnisharp', 'grepper', 'filetype'])
|
||||
let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
|
||||
endif
|
||||
if !exists('g:airline_section_y')
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||
|
||||
Reference in New Issue
Block a user