diff --git a/README.markdown b/README.markdown index f70cfdd..1d925f1 100644 --- a/README.markdown +++ b/README.markdown @@ -43,9 +43,11 @@ Date: `d` Set current task's creation date to the current date `date` (Insert mode) Insert the current date -Mark as done: +Mark / unmark as done: `x` Mark current task as done `X` Mark all tasks as done +`u` Mark current task as undone +`U` Mark all tasks as undone `D` Move completed tasks to done.txt This plugin detects any text file with the name todo.txt or done.txt with an optional prefix that ends in a period (e.g. second.todo.txt, example.done.txt). diff --git a/autoload/todo/txt.vim b/autoload/todo/txt.vim index 18bc7fe..2e325fd 100644 --- a/autoload/todo/txt.vim +++ b/autoload/todo/txt.vim @@ -39,7 +39,7 @@ function! todo#txt#replace_date() endfunction function! todo#txt#mark_as_done() - call s:remove_priority() + " call s:remove_priority() call todo#txt#prepend_date() execute 'normal! Ix ' endfunction @@ -48,6 +48,14 @@ function! todo#txt#mark_all_as_done() :g!/^x /:call todo#txt#mark_as_done() endfunction +function! todo#txt#unmark_as_done() + :s/^x \(\d\{2,4\}-\d\{2\}-\d\{2\} \)\?//ge +endfunction + +function! todo#txt#unmark_all_as_done() + :g/^x /:call todo#txt#unmark_as_done() +endfunction + function! s:append_to_file(file, lines) let l:lines = [] diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 548617b..db3e9db 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -53,6 +53,13 @@ vnoremap