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,9 +12,11 @@ mappings, to help with edition of these files:
|
|||||||
|
|
||||||
`<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)
|
||||||
|
|
||||||
`date<tab>` : (Insert mode) Insert the current date
|
`DD` : Mark all tasks as completed
|
||||||
|
|
||||||
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
If you want the help installed run ":helptags ~/.vim/doc" inside vim after having copied the files.
|
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
|
Then you will be able to get the commands help with: :h todo.txt
|
||||||
|
|||||||
16
Todo.txt
16
Todo.txt
@@ -3,11 +3,11 @@
|
|||||||
(B) 2011-05-31 Start documentation @doc
|
(B) 2011-05-31 Start documentation @doc
|
||||||
(C) 2011-06-01 Improve syntax file @syntax
|
(C) 2011-06-01 Improve syntax file @syntax
|
||||||
x 2014-04-27 2011-05-30 Contact main project for reference
|
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 Create README.markdown to be published in github @doc
|
||||||
X 2011-05-30 Implement colorized priorities @syntax
|
x 2011-05-30 Implement colorized priorities @syntax
|
||||||
X 2011-05-30 Implement filetype detection @ftdetect
|
x 2011-05-30 Implement filetype detection @ftdetect
|
||||||
X 2011-05-30 Sort lines per priority @ftplugin
|
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 Highlight date, project and context of tasks with no priority @syntax
|
||||||
X 2011-05-31 Stop breaking lines automatically @ftplugin
|
x 2011-05-31 Stop breaking lines automatically @ftplugin
|
||||||
X 2011-06-06 Easier date input @ftplugin
|
x 2011-06-06 Easier date input @ftplugin
|
||||||
X 2011-06-06 Implement foldings @ftplugin
|
x 2011-06-06 Implement foldings @ftplugin
|
||||||
|
|||||||
12
doc/todo.txt
12
doc/todo.txt
@@ -3,12 +3,14 @@
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
COMMANDS *todo-commands*
|
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)
|
||||||
|
|
||||||
`date<tab>` : (Insert mode) Insert the current date
|
`DD` : Mark all tasks as completed
|
||||||
|
|
||||||
<Leader> is \ by default, so <Leader>-s means you type \s
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
|
<leader> is \ by default, so <leader>-s means you type \s
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ function! TodoTxtMarkAsDone()
|
|||||||
call TodoTxtPrependDate()
|
call TodoTxtPrependDate()
|
||||||
normal! Ix
|
normal! Ix
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtMarkAllAsDone()
|
||||||
|
:g!/^x /TodoTxtMarkAsDone()
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Mappings {{{1
|
" Mappings {{{1
|
||||||
" Sort tasks {{{2
|
" Sort tasks {{{2
|
||||||
@@ -59,6 +63,11 @@ if !hasmapto("<leader>D",'v')
|
|||||||
if !hasmapto("<leader>D",'v')
|
if !hasmapto("<leader>D",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>D :call TodoTxtMarkAsDone()<CR>
|
vnoremap <script> <silent> <buffer> <leader>D :call TodoTxtMarkAsDone()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Mark all done {{{2
|
||||||
|
if !hasmapto("DD",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> DD :call TodoTxtMarkAllAsDone()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
" Folding {{{1
|
" Folding {{{1
|
||||||
" Options {{{2
|
" Options {{{2
|
||||||
|
|||||||
Reference in New Issue
Block a user