mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-04-08 19:35:31 +02:00
Add custom statusline for vimodoro.
This commit is contained in:
parent
f1ba5a03db
commit
3cf8fe350c
@ -229,6 +229,11 @@ function! airline#extensions#load()
|
||||
call add(s:loaded_ext, 'undotree')
|
||||
endif
|
||||
|
||||
if exists(':RTM')
|
||||
call airline#extensions#vimodoro#init(s:ext)
|
||||
call add(s:loaded_ext, 'vimodoro')
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#hunks#enabled', 1)
|
||||
\ && (exists('g:loaded_signify')
|
||||
\ || exists('g:loaded_gitgutter')
|
||||
|
25
autoload/airline/extensions/vimodoro.vim
Normal file
25
autoload/airline/extensions/vimodoro.vim
Normal file
@ -0,0 +1,25 @@
|
||||
" MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
|
||||
" Plugin: https://github.com/VimfanTPdvorak/vimodoro.vim
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':RTM')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#vimodoro#apply(...)
|
||||
if exists('t:vimodoro')
|
||||
if &ft == 'vimodoro'
|
||||
if exists(':PomodoroStatus')
|
||||
call airline#extensions#apply_left_override('vimodoro', '%{PomodoroStatus(1)}')
|
||||
else
|
||||
call airline#extensions#apply_left_override('vimodoro', g:airline_section_y)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#vimodoro#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#vimodoro#apply')
|
||||
endfunction
|
Loading…
x
Reference in New Issue
Block a user