mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-15 05:13:46 -05:00
Added support to mark multiple tasks as done.
This commit is contained in:
@@ -16,6 +16,22 @@ set cpo&vim
|
||||
setlocal textwidth=0
|
||||
setlocal wrapmargin=0
|
||||
|
||||
" Functions {{{!
|
||||
function! s:TodoTxtRemovePriority()
|
||||
normal! da)
|
||||
:s/^\s\+//g
|
||||
endfunction
|
||||
|
||||
function! s:TodoTxtPrependDate()
|
||||
normal! 0"=strftime("%Y-%m-%d ")
|
||||
P
|
||||
endfunction
|
||||
|
||||
function! TodoTxtMarkAsDone()
|
||||
call s:TodoTxtRemovePriority()
|
||||
call s:TodoTxtPrependDate()
|
||||
normal! Ix
|
||||
endfunction
|
||||
|
||||
" Mappings {{{1
|
||||
" Sort tasks {{{2
|
||||
@@ -37,7 +53,11 @@ endif
|
||||
endif
|
||||
|
||||
" Mark done {{{2
|
||||
nnoremap <script> <silent> <buffer> <leader>D 0"=strftime("x %Y-%m-%d ")<CR>P
|
||||
if !hasmapto("<leader>D",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>D :call TodoTxtMarkAsDone()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<leader>D",'v')
|
||||
vnoremap <script> <silent> <buffer> <leader>D :call TodoTxtMarkAsDone()<CR>
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user