diff options
author | Teddy Wing | 2016-06-03 09:37:02 -0400 |
---|---|---|
committer | Teddy Wing | 2016-06-03 09:37:02 -0400 |
commit | caec071d634877f05d53acf4f38a1039a1f162d9 (patch) | |
tree | a09339eb354368cbd6f55c3c53893c7c0a75ab22 /autoload/todo.vim | |
parent | 17684a8b4898e5aecd33b86689c386e483ab698f (diff) | |
download | vim-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.vim | 14 |
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 |