Cancel tasks with <localleader>c

This commit is contained in:
David Beniamine
2015-09-16 17:02:42 +02:00
parent d3b011b718
commit 644b6d6628
3 changed files with 30 additions and 9 deletions

View File

@@ -58,19 +58,27 @@ function! todo#PrependDate()
normal! 0"=strftime("%Y-%m-%d ")
P
endfunction
function! todo#ToggleMarkAsDone(status)
if (getline(".") =~ 'x\s*\d\{4\}')
if (getline(".") =~ 'x\s*\d\{4\}')
:call todo#UnMarkAsDone(a:status)
else
else
:call todo#MarkAsDone(a:status)
endif
endfunction
function! todo#UnMarkAsDone()
function! todo#UnMarkAsDone(status)
if a:status==''
let pat=''
else
let pat=' '.a:status
endif
exec ':s/\s*x\s*\d\{4}-\d\{1,2}-\d\{1,2}'.pat.'\s*//g'
endfunction
function! todo#MarkAsDone(status)
if a:status!=''
exec 'normal! I'.a:status.' '
endif
call todo#PrependDate()
normal! Ix