From 8d8913a6006221bd867f0bdf27883b456706b39f Mon Sep 17 00:00:00 2001 From: Hans Anderson Date: Fri, 31 Oct 2014 18:23:27 -0500 Subject: [PATCH] Easy to add a priority to the current line - several new leader keys to add priority to the current line - updated README --- README.markdown | 10 ++++++++-- ftplugin/todo.vim | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 6eefede..9335148 100644 --- a/README.markdown +++ b/README.markdown @@ -14,9 +14,15 @@ mappings, to help with edition of these files: `-s@` : Sort the file on @Contexts -`-j` : Lower the priority (cursor must by on priority) +`-j` : Lower the priority of the current line -`-k` : Increase the priority (cursor must by on priority) +`-k` : Increase the priority of the current line + +`-a` : Add the priority (A) to the current line + +`-c` : Add the priority (B) to the current line + +`-b` : Add the priority (C) to the current line `-d` : Insert the current date diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index a9b73a6..7dd9f39 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -64,6 +64,15 @@ function! TodoTxtPrioritizeDecrease() normal! 0f)h endfunction +function! TodoTxtPrioritizeAdd (priority) + " Need to figure out how to only do this if the first visible letter in a line is not ( + :call TodoTxtPrioritizeAddAction(a:priority) +endfunction + +function! TodoTxtPrioritizeAddAction (priority) + execute "normal! mq0i(".a:priority.") \`q" +endfunction + if !hasmapto("j",'n') nnoremap