From caec071d634877f05d53acf4f38a1039a1f162d9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 3 Jun 2016 09:37:02 -0400 Subject: Add Escalate mapping Define the `todo#Escalate()` function which does the opposite of `todo#Descalate()` and add a mapping to invoke the function. --- autoload/todo.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'autoload') 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 -- cgit v1.2.3