diff options
author | Teddy Wing | 2020-03-22 00:07:05 +0100 |
---|---|---|
committer | Teddy Wing | 2020-03-22 00:13:44 +0100 |
commit | 01c9a08982786c4508fea4893476935a553330fe (patch) | |
tree | 1f19ed2c339e68ea0b80ff6a08165fbbcc096e0f | |
parent | 4d0c7d92b0a415b2c59caddfde94248117fd45cc (diff) | |
download | vim-twodo-01c9a08982786c4508fea4893476935a553330fe.tar.bz2 |
Add repeat support
Commands should be able to be repeated. Makes it easier to mark several
to-dos complete in a row, for example.
-rw-r--r-- | autoload/todo.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/autoload/todo.vim b/autoload/todo.vim index 8cfa986..070d3f5 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -4,6 +4,8 @@ function! todo#MarkComplete() keeppatterns s/\v^(\s*)[-_!xS] /\1v / call winrestview(view) + + silent! call repeat#set("\<Plug>TwodoMarkComplete", v:count) endfunction @@ -13,6 +15,8 @@ function! todo#MarkDeleted() keeppatterns s/\v^(\s*)[-_!vS] /\1x / call winrestview(view) + + silent! call repeat#set("\<Plug>TwodoMarkDeleted", v:count) endfunction @@ -22,6 +26,8 @@ function! todo#MarkPartiallyCompleted() keeppatterns s/\v^(\s*)[-_!xv] /\1S / call winrestview(view) + + silent! call repeat#set("\<Plug>TwodoMarkPartiallyCompleted", v:count) endfunction @@ -31,6 +37,8 @@ function! todo#RemoveOldTodos() keeppatterns g/^\s*[vx] /d call winrestview(view) + + silent! call repeat#set("\<Plug>TwodoRemoveOldTodos", v:count) endfunction @@ -49,6 +57,8 @@ function! todo#Escalate() endif call setline(line('.'), todo) + + silent! call repeat#set("\<Plug>TwodoEscalate", v:count) endfunction @@ -67,4 +77,6 @@ function! todo#Descalate() endif call setline(line('.'), todo) + + silent! call repeat#set("\<Plug>TwodoDescalate", v:count) endfunction |