From 45aa73bf5e0836417c3a9f13491248eb41bef1a9 Mon Sep 17 00:00:00 2001 From: Leandro Freitas Date: Sun, 27 Apr 2014 21:26:58 -0300 Subject: [PATCH] Fixes #14. Also changes some shortcuts --- README.markdown | 10 ++++++---- doc/todo.txt | 10 ++++++---- ftplugin/todo.vim | 23 ++++++++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/README.markdown b/README.markdown index 4fefb43..f330803 100644 --- a/README.markdown +++ b/README.markdown @@ -12,11 +12,13 @@ mappings, to help with edition of these files: `-d` : Insert the current date -`-D` : Mark task as done (inserts current date as completion date) - -`DD` : Mark all tasks as completed - `date` : (Insert mode) Insert the current date +`-x` : Mark task as done (inserts current date as completion date) + +`-X` : Mark all tasks as completed + +`-D` : Remove completed tasks + If you want the help installed run ":helptags ~/.vim/doc" inside vim after having copied the files. Then you will be able to get the commands help with: :h todo.txt diff --git a/doc/todo.txt b/doc/todo.txt index fee59eb..961bc4a 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -7,10 +7,12 @@ COMMANDS *todo-commands* `-d` : Insert the current date -`-D` : Mark task as done (inserts current date as completion date) - -`DD` : Mark all tasks as completed - `date` : (Insert mode) Insert the current date +`-x` : Mark task as done (inserts current date as completion date) + +`-X` : Mark all tasks as completed + +`-D` : Remove completed tasks + is \ by default, so -s means you type \s diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index e3c09d2..e892288 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -32,7 +32,11 @@ function! TodoTxtMarkAsDone() endfunction function! TodoTxtMarkAllAsDone() - :g!/^x /TodoTxtMarkAsDone() + :g!/^x /:call TodoTxtMarkAsDone() +endfunction + +function! TodoTxtRemoveCompleted() + :g/^x /d endfunction " Mappings {{{1 @@ -55,17 +59,22 @@ if !hasmapto("d",'v') endif " Mark done {{{2 -if !hasmapto("D",'n') - nnoremap