Skip to content

Commit

Permalink
plugin: Add extension for vimodoro plugin (#2652)
Browse files Browse the repository at this point in the history
* Adds integration with vimodoro information.

---------
Co-authored-by: Rowan <rowan.douglas@vimabc.xyz>
Co-authored-by: Eddy <eddy_c@novellpharm.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
  • Loading branch information
VimfanTPdvorak committed Oct 10, 2023
1 parent f1ba5a0 commit 4757756
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,4 @@ If you are interested in becoming a maintainer (we always welcome more maintaine
[61]: http://github.com/lambdalisue/battery.vim/
[62]: http://github.com/rbong/vim-flog/
[63]: https://github.com/lewis6991/gitsigns.nvim
[64]: https://github.com/VimfanTPdvorak/vimodoro
5 changes: 5 additions & 0 deletions autoload/airline/extensions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
25 changes: 25 additions & 0 deletions autoload/airline/extensions/vimodoro.vim
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions doc/airline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,11 @@ Vim-CMake <https://github.com/cdelledonne/vim-cmake>
* enable/disable Vim-CMake integration >
let g:airline#extensions#vimcmake#enabled = 1
<
------------------------------------- *airline-vimodoro*
Vimodoro <https://github.com/VimfanTPdvorak/vimodoro>

No configuration available.

------------------------------------- *airline-vimtex*
vimtex <https://github.com/lervag/vimtex>

Expand Down

0 comments on commit 4757756

Please sign in to comment.