mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-15 13:23:46 -05:00
Added shortcut to mark all tasks as done
This commit is contained in:
@@ -12,7 +12,9 @@ mappings, to help with edition of these files:
|
||||
|
||||
`<leader>-d` : Insert the current date
|
||||
|
||||
`<leader>-D` : Insert the current date with leading `x` (completed)
|
||||
`<leader>-D` : Mark task as done (inserts current date as completion date)
|
||||
|
||||
`DD` : Mark all tasks as completed
|
||||
|
||||
`date<tab>` : (Insert mode) Insert the current date
|
||||
|
||||
|
||||
16
Todo.txt
16
Todo.txt
@@ -3,11 +3,11 @@
|
||||
(B) 2011-05-31 Start documentation @doc
|
||||
(C) 2011-06-01 Improve syntax file @syntax
|
||||
x 2014-04-27 2011-05-30 Contact main project for reference
|
||||
X 2011-05-30 Create README.markdown to be published in github @doc
|
||||
X 2011-05-30 Implement colorized priorities @syntax
|
||||
X 2011-05-30 Implement filetype detection @ftdetect
|
||||
X 2011-05-30 Sort lines per priority @ftplugin
|
||||
X 2011-05-31 Highlight date, project and context of tasks with no priority @syntax
|
||||
X 2011-05-31 Stop breaking lines automatically @ftplugin
|
||||
X 2011-06-06 Easier date input @ftplugin
|
||||
X 2011-06-06 Implement foldings @ftplugin
|
||||
x 2011-05-30 Create README.markdown to be published in github @doc
|
||||
x 2011-05-30 Implement colorized priorities @syntax
|
||||
x 2011-05-30 Implement filetype detection @ftdetect
|
||||
x 2011-05-30 Sort lines per priority @ftplugin
|
||||
x 2011-05-31 Highlight date, project and context of tasks with no priority @syntax
|
||||
x 2011-05-31 Stop breaking lines automatically @ftplugin
|
||||
x 2011-06-06 Easier date input @ftplugin
|
||||
x 2011-06-06 Implement foldings @ftplugin
|
||||
|
||||
10
doc/todo.txt
10
doc/todo.txt
@@ -3,12 +3,14 @@
|
||||
==============================================================================
|
||||
COMMANDS *todo-commands*
|
||||
|
||||
`<Leader>-s` : Sort the file
|
||||
`<leader>-s` : Sort the file
|
||||
|
||||
`<Leader>-d` : Insert the current date
|
||||
`<leader>-d` : Insert the current date
|
||||
|
||||
`<Leader>-D` : Insert the current date with leading `x` (completed)
|
||||
`<leader>-D` : Mark task as done (inserts current date as completion date)
|
||||
|
||||
`DD` : Mark all tasks as completed
|
||||
|
||||
`date<tab>` : (Insert mode) Insert the current date
|
||||
|
||||
<Leader> is \ by default, so <Leader>-s means you type \s
|
||||
<leader> is \ by default, so <leader>-s means you type \s
|
||||
|
||||
@@ -31,6 +31,10 @@ function! TodoTxtMarkAsDone()
|
||||
call TodoTxtPrependDate()
|
||||
normal! Ix
|
||||
endfunction
|
||||
|
||||
function! TodoTxtMarkAllAsDone()
|
||||
:g!/^x /TodoTxtMarkAsDone()
|
||||
endfunction
|
||||
|
||||
" Mappings {{{1
|
||||
" Sort tasks {{{2
|
||||
@@ -59,6 +63,11 @@ if !hasmapto("<leader>D",'v')
|
||||
if !hasmapto("<leader>D",'v')
|
||||
vnoremap <script> <silent> <buffer> <leader>D :call TodoTxtMarkAsDone()<CR>
|
||||
endif
|
||||
|
||||
" Mark all done {{{2
|
||||
if !hasmapto("DD",'n')
|
||||
nnoremap <script> <silent> <buffer> DD :call TodoTxtMarkAllAsDone()<CR>
|
||||
endif
|
||||
|
||||
" Folding {{{1
|
||||
" Options {{{2
|
||||
|
||||
Reference in New Issue
Block a user