diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 96c5ac5..2cc7958 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -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 if !hasmapto("s",'n') @@ -37,7 +53,11 @@ endif " Mark done {{{2 if !hasmapto("D",'n') - nnoremap