From 04a94957b9daa53a62e59bbba733983f2c55ff55 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Sun, 27 Apr 2014 15:56:24 +1100 Subject: [PATCH 1/2] Fixes #13, also a little bit of refactoring --- ftplugin/todo.vim | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 2cc7958..d3ec73a 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -18,18 +18,17 @@ setlocal wrapmargin=0 " Functions {{{! function! s:TodoTxtRemovePriority() - normal! da) - :s/^\s\+//g + :s/^(\w)\s\+//ge endfunction -function! s:TodoTxtPrependDate() +function! TodoTxtPrependDate() normal! 0"=strftime("%Y-%m-%d ") P endfunction function! TodoTxtMarkAsDone() call s:TodoTxtRemovePriority() - call s:TodoTxtPrependDate() - normal! Ix  + call TodoTxtPrependDate() + normal! Ix endfunction " Mappings {{{1 @@ -39,16 +38,16 @@ if !hasmapto("s",'n') endif " Insert date {{{2 -if !hasmapto("d",'n') - nnoremap