From 00ecbeb8b7dc827e6010fafe770cc1f5f4d7eee8 Mon Sep 17 00:00:00 2001 From: Risto Saarelma Date: Fri, 8 Feb 2019 10:26:17 +0200 Subject: [PATCH] Add setting for dropping priority metadata The default behavior of todo.txt is to add priority metadata to done items with priority tags so that the priority can be restored when the item is marked as undone. If you want to have cleaner done items and just remove the priority information when the item is set as done, set let g:TodoTxtStripDoneItemPriority=1 --- autoload/todo.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/todo.vim b/autoload/todo.vim index d3026d7..c6c679c 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -102,7 +102,11 @@ endfunction function! todo#MarkAsDone(status) call todo#CreateNewRecurrence(1) - exec ':s/\C^(\([A-Z]\))\(.*\)/\2 pri:\1/e' + if get(g:, 'TodoTxtStripDoneItemPriority', 0) + exec ':s/\C^(\([A-Z]\))\(.*\)/\2/e' + else + exec ':s/\C^(\([A-Z]\))\(.*\)/\2 pri:\1/e' + endif if a:status!='' exec 'normal! I'.a:status.' ' endif