aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/todo.vim
diff options
context:
space:
mode:
authorTeddy Wing2016-06-03 09:37:02 -0400
committerTeddy Wing2016-06-03 09:37:02 -0400
commitcaec071d634877f05d53acf4f38a1039a1f162d9 (patch)
treea09339eb354368cbd6f55c3c53893c7c0a75ab22 /autoload/todo.vim
parent17684a8b4898e5aecd33b86689c386e483ab698f (diff)
downloadvim-twodo-caec071d634877f05d53acf4f38a1039a1f162d9.tar.bz2
Add Escalate mapping
Define the `todo#Escalate()` function which does the opposite of `todo#Descalate()` and add a mapping to invoke the function.
Diffstat (limited to 'autoload/todo.vim')
-rw-r--r--autoload/todo.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/autoload/todo.vim b/autoload/todo.vim
index 926f1e7..758d0d5 100644
--- a/autoload/todo.vim
+++ b/autoload/todo.vim
@@ -1,4 +1,18 @@
function! todo#Escalate()
+ let todo = getline('.')
+
+ " First non-whitespace character
+ let col = match(todo, '\S')
+
+ let priority = todo[col]
+
+ if priority ==# '_'
+ let todo = substitute(todo, '_', '-', '')
+ elseif priority ==# '-'
+ let todo = substitute(todo, '-', '!', '')
+ endif
+
+ call setline(line('.'), todo)
endfunction