From 484c12771ea15096d1812e7427f31cb94b0c506e Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Wed, 5 Apr 2017 11:15:59 -0500 Subject: [PATCH] Improve todo#PrependDate to follow format Add logic to place the completion date after the priority, if it exists, when completing a task. --- autoload/todo.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/todo.vim b/autoload/todo.vim index 8c228af..9e21886 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -62,7 +62,11 @@ function! todo#RemovePriority() endfunction function! todo#PrependDate() - normal! 0"=strftime("%Y-%m-%d ") P + if (getline(".") =~ '\v^\(') + execute "normal! 0f)a\\l\"=strftime(\"%Y-%m-%d\")\P" + else + normal! 0"=strftime("%Y-%m-%d ") P + endif endfunction function! todo#ToggleMarkAsDone(status)