mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-15 13:23:46 -05:00
Fixes #14. Also changes some shortcuts
This commit is contained in:
@@ -12,11 +12,13 @@ mappings, to help with edition of these files:
|
|||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<leader>-d` : Insert the current date
|
||||||
|
|
||||||
`<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
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
|
`<leader>-x` : Mark task as done (inserts current date as completion date)
|
||||||
|
|
||||||
|
`<leader>-X` : Mark all tasks as completed
|
||||||
|
|
||||||
|
`<leader>-D` : Remove completed tasks
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
10
doc/todo.txt
10
doc/todo.txt
@@ -7,10 +7,12 @@ COMMANDS *todo-commands*
|
|||||||
|
|
||||||
`<leader>-d` : Insert the current date
|
`<leader>-d` : Insert the current date
|
||||||
|
|
||||||
`<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
|
`date<tab>` : (Insert mode) Insert the current date
|
||||||
|
|
||||||
|
`<leader>-x` : Mark task as done (inserts current date as completion date)
|
||||||
|
|
||||||
|
`<leader>-X` : Mark all tasks as completed
|
||||||
|
|
||||||
|
`<leader>-D` : Remove completed tasks
|
||||||
|
|
||||||
<leader> is \ by default, so <leader>-s means you type \s
|
<leader> is \ by default, so <leader>-s means you type \s
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ function! TodoTxtMarkAsDone()
|
|||||||
normal! Ix
|
normal! Ix
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! TodoTxtMarkAllAsDone()
|
function! TodoTxtMarkAllAsDone()
|
||||||
|
:g!/^x /:call TodoTxtMarkAsDone()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtRemoveCompleted()
|
||||||
:g/^x /d
|
:g/^x /d
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -55,17 +59,22 @@ if !hasmapto("<leader>d",'v')
|
|||||||
vnoremap <script> <silent> <buffer> <leader>d :call TodoTxtPrependDate()<CR>
|
vnoremap <script> <silent> <buffer> <leader>d :call TodoTxtPrependDate()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Mark done {{{2
|
" Mark done {{{2
|
||||||
if !hasmapto("<leader>D",'n')
|
if !hasmapto("<leader>x",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>x :call TodoTxtMarkAsDone()<CR>
|
nnoremap <script> <silent> <buffer> <leader>x :call TodoTxtMarkAsDone()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !hasmapto("<leader>D",'v')
|
if !hasmapto("<leader>x",'v')
|
||||||
vnoremap <script> <silent> <buffer> <leader>x :call TodoTxtMarkAsDone()<CR>
|
vnoremap <script> <silent> <buffer> <leader>x :call TodoTxtMarkAsDone()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Mark all done {{{2
|
" Mark all done {{{2
|
||||||
if !hasmapto("DD",'n')
|
if !hasmapto("<leader>X",'n')
|
||||||
|
nnoremap <script> <silent> <buffer> <leader>X :call TodoTxtMarkAllAsDone()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Remove completed {{{2
|
||||||
|
if !hasmapto("<leader>D",'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>D :call TodoTxtRemoveCompleted()<CR>
|
nnoremap <script> <silent> <buffer> <leader>D :call TodoTxtRemoveCompleted()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user