From ceed8bf8418ce4825424b38b7f8ded62500c2c52 Mon Sep 17 00:00:00 2001 From: Brian Phillips Date: Wed, 2 Dec 2009 15:17:12 -0600 Subject: [PATCH] more tweaks --- vim/plugin/todo.vim | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/vim/plugin/todo.vim b/vim/plugin/todo.vim index 3a91bd5..5944efe 100644 --- a/vim/plugin/todo.vim +++ b/vim/plugin/todo.vim @@ -11,18 +11,21 @@ nnoremap tl :TodoList nnoremap ta :TodoAdd function! TodoList(args) - let list_args = a:args . ' ' . g:todo_project_context + let list_args = a:args + if match(list_args, g:todo_project_context) == -1 + let list_args .= " " . g:todo_project_context + endif call Todo('list ' . list_args) nnoremap q :q - execute 'nnoremap o :call TodoAddInput():silent TodoList ' . list_args . '' - execute 'nnoremap r :silent TodoList ' . list_args . '' - execute 'nnoremap d :silent call TodoDoneCurrent():silent TodoList ' . list_args . '' - execute 'nnoremap D :silent call TodoDeleteCurrent():silent TodoList ' . list_args . '' - execute 'nnoremap p :call TodoPriorityCurrent():silent TodoList ' . list_args . '' - execute 'nnoremap P :call TodoAppendProjectCurrent():silent TodoList ' . list_args . '' - execute 'nnoremap C :call TodoAppendContextCurrent():silent TodoList ' . list_args . '' - execute 'nnoremap + :silent call TodoPriorityAdjust(1):silent TodoList ' . list_args . '' - execute 'nnoremap - :silent call TodoPriorityAdjust(-1):silent TodoList ' . list_args . '' + execute 'nnoremap o :call TodoAddInput():TodoList ' . list_args . '' + execute 'nnoremap r :TodoList ' . list_args . '' + execute 'nnoremap d :silent call TodoDoneCurrent():TodoList ' . list_args . '' + execute 'nnoremap D :silent call TodoDeleteCurrent():TodoList ' . list_args . '' + execute 'nnoremap p :call TodoPriorityCurrent():TodoList ' . list_args . '' + execute 'nnoremap P :call TodoAppendProjectCurrent():TodoList ' . list_args . '' + execute 'nnoremap C :call TodoAppendContextCurrent():TodoList ' . list_args . '' + execute 'nnoremap + :silent call TodoPriorityAdjust(-1):TodoList ' . list_args . '' + execute 'nnoremap - :silent call TodoPriorityAdjust(1):TodoList ' . list_args . '' endfunction function! TodoPriorityAdjust(amount) @@ -42,12 +45,18 @@ function! TodoPriorityAdjust(amount) endif let index += 1 endwhile + if index == len(priorities) + call TodoAction('pri ' . id . ' ' . priorities[0]) + endif endfunction function! TodoAddInput() call inputsave() let task = input("Task: ") + if len(g:todo_project_context) > 0 + let task .= " " . g:todo_project_context + endif call inputrestore() call TodoAction('add "' . task . '"') endfunction