Updated combo tracking method!
This commit is contained in:
parent
53aec8b53a
commit
b6a5636325
2 changed files with 2 additions and 15 deletions
|
@ -11,10 +11,7 @@ _____________\///______\///__\///___\///___\///___________________\////////_____
|
||||||
===========================================================================================================================================
|
===========================================================================================================================================
|
||||||
Each keystroke in insert mode increases your combo,
|
Each keystroke in insert mode increases your combo,
|
||||||
but not typing for 1 second resets it.
|
but not typing for 1 second resets it.
|
||||||
Hacks are not patched around : you can keep a key pressed to increase your
|
The script is triggered whenever a text edit is detected in insert mode.
|
||||||
combo, and CTRL+SHIFT+V will all be counted as a combo.
|
|
||||||
( since afaik vim does not allow to remap all letters to an action combo
|
|
||||||
counter is increased with every cursor movement )
|
|
||||||
|
|
||||||
Best score is displayed next to the current combo in square brackets.
|
Best score is displayed next to the current combo in square brackets.
|
||||||
When a new high score is achieved, it is saved inside .vim as .combo.
|
When a new high score is achieved, it is saved inside .vim as .combo.
|
||||||
|
|
|
@ -28,15 +28,5 @@ else
|
||||||
endif
|
endif
|
||||||
let g:last_combo = reltime()
|
let g:last_combo = reltime()
|
||||||
endfunction
|
endfunction
|
||||||
autocmd CursorMovedI * call UpdateCombo() " Every time the cursor moves, call combo function
|
autocmd TextChangedI * call UpdateCombo() " Every time text in the file changes, call combo function
|
||||||
function! ResetCombo()
|
|
||||||
let g:combo_counter = 0
|
|
||||||
call writefile(0, "$HOME/.vim/.combo")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" NOT NECESSARY! Only enable if you find yourself cheating by staying in insert mode!
|
|
||||||
" inoremap <Left> <C-o>:let g:combo_counter=0<CR><Left>
|
|
||||||
" inoremap <Right> <C-o>:let g:combo_counter=0<CR><Right>
|
|
||||||
" inoremap <Up> <C-o>:let g:combo_counter=0<CR><Up>
|
|
||||||
" inoremap <Down> <C-o>:let g:combo_counter=0<CR><Down>
|
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue