Added combo bar
This commit is contained in:
parent
6d5f180e77
commit
a2779319fe
1 changed files with 13 additions and 4 deletions
|
@ -26,15 +26,24 @@ endif
|
||||||
" Configure variables
|
" Configure variables
|
||||||
let g:combo_counter = 0 " The actual combo variable
|
let g:combo_counter = 0 " The actual combo variable
|
||||||
let g:timeout = 1
|
let g:timeout = 1
|
||||||
|
let g:emphasis = ''
|
||||||
|
let g:mult = 10
|
||||||
let g:last_combo = reltime() " Set current time as last combo time
|
let g:last_combo = reltime() " Set current time as last combo time
|
||||||
let g:airline_section_b = 'ᛥ %{g:combo_counter}|%{g:best_combo} [%{g:best_combo_all}]' " I use airline vim and inserted the combo meter in it
|
let g:airline_section_b = 'ᛥ %{g:combo_counter}|%{g:best_combo}|%{g:best_combo_all} %{g:emphasis}'
|
||||||
function! UpdateCombo()
|
function! UpdateCombo()
|
||||||
if reltimefloat(reltime(g:last_combo)) > g:timeout " Timeout is 1 second
|
if reltimefloat(reltime(g:last_combo)) > g:timeout
|
||||||
call SaveCombo()
|
call SaveCombo()
|
||||||
let g:combo_counter = 1
|
let g:combo_counter = 1
|
||||||
else
|
else
|
||||||
let g:combo_counter +=1
|
let g:combo_counter +=1
|
||||||
endif
|
endif
|
||||||
|
let g:emphasis = ''
|
||||||
|
let ceil = g:combo_counter / g:mult
|
||||||
|
let i = 0
|
||||||
|
while i < ceil
|
||||||
|
let g:emphasis = g:emphasis . 'ᛞ'
|
||||||
|
let i+=1
|
||||||
|
endwhile
|
||||||
let g:last_combo = reltime()
|
let g:last_combo = reltime()
|
||||||
endfunction
|
endfunction
|
||||||
function! SaveCombo()
|
function! SaveCombo()
|
||||||
|
|
Loading…
Reference in a new issue