Autocommit of file /home/julien/.dotfiles/vim/.vim/bundle/vimtodo/autoload/vimtodo...
authorJulien Valroff <julien@kirya.net>
Tue, 1 Nov 2011 08:08:08 +0000 (09:08 +0100)
committerJulien Valroff <julien@kirya.net>
Tue, 1 Nov 2011 08:08:08 +0000 (09:08 +0100)
.vim/bundle/vimtodo/autoload/vimtodo.vim [new file with mode: 0644]

diff --git a/.vim/bundle/vimtodo/autoload/vimtodo.vim b/.vim/bundle/vimtodo/autoload/vimtodo.vim
new file mode 100644 (file)
index 0000000..0380b5e
--- /dev/null
@@ -0,0 +1,36 @@
+" Vim filetype plugin for heirarchical TODO lists
+" Maintainer:   Mark Harrison <mark@mivok.net>
+" License:      ISC - See LICENSE file for details
+
+" Utility functions
+" TodoParseTaskState - Parse TODO(t) into state and shortcut key {{{1
+function! vimtodo#TodoParseTaskState(state)
+    let state=matchstr(a:state, '^[A-Z]\+')
+    let key=matchstr(a:state, '\(^[A-Z]\+(\)\@<=[a-zA-Z0-9]\()\)\@=')
+    return { "state": state, "key": key }
+endfunction
+"1}}}
+
+" Default settings
+" Set - setup script variables {{{1
+function! vimtodo#Set(varname, value)
+    if !exists(a:varname)
+        exec "let" a:varname "=" string(a:value)
+    endif
+endfunction
+"1}}}
+
+" Default variables {{{1
+function! vimtodo#SetDefaultVars()
+    call vimtodo#Set("g:todo_states",
+        \[["TODO(t)", "|", "DONE(d)", "CANCELLED(c)"],
+        \["WAITING(w)", "CLOSED(l)"]])
+    call vimtodo#Set("g:todo_state_colors", { "TODO" : "Blue", "DONE": "Green",
+        \ "CANCELLED" : "Red", "WAITING": "Yellow", "CLOSED": "Grey" })
+    call vimtodo#Set("g:todo_checkbox_states", [[" ", "X"], ["+", "-", "."],
+        \["Y", "N", "?"]])
+    call vimtodo#Set("g:todo_log_done", 1)
+    call vimtodo#Set("g:todo_log_into_drawer", "LOGBOOK")
+    call vimtodo#Set("g:todo_done_file", "done.txt")
+endfunction
+"1}}}