diff --git a/vimrc b/vimrc index fa535a9..ba0e4ef 100644 --- a/vimrc +++ b/vimrc @@ -39,8 +39,9 @@ inoremap nnoremap :Limelight!! nnoremap :call ACPToggleMargins() nnoremap :w -nnoremap :call ACPNModeTodo() +nnoremap :call ACPActodoTodo() nnoremap :call ACPToggleSpellEnUs() +nnoremap :call ACPAdocTodo() nnoremap :call ACPToggleSpellEnGb() nnoremap nnoremap @@ -261,7 +262,25 @@ function! ACPToggleSpellEnGb() endif endfunction -function! ACPNModeTodo() +function! ACPActodoTodo() + " Toggles between TODO, WORK, WAIT, DONE, and blank. + " All are highlighted except DONE and blank. + " Must be at the start of the line, optionally preceeded with + " whitespace. This makes it work for actodo lists. + if getline(line(".")) =~# "TODO: " + s/^\(\s*\)TODO: /\1WORK: /e + elseif getline(line(".")) =~# "WORK: " + s/^\(\s*\)WORK: /\1WAIT: /e + elseif getline(line(".")) =~# "WAIT: " + s/^\(\s*\)WAIT: /\1DONE: /e + elseif getline(line(".")) =~# "DONE: " + s/^\(\s*\)DONE: /\1/e + else + s/^\(\s*\)/\1TODO: /e + endif +endfunction + +function! ACPAdocTodo() " Toggles between TODO, WORK, WAIT, DONE, and blank. " All are highlighted except DONE and blank. " Must be at the start of the line, optionally preceeded with an