1 " Vim filetype plugin for heirarchical TODO lists
2 " Maintainer: Mark Harrison <mark@mivok.net>
3 " License: ISC - See LICENSE file for details
6 " TodoParseTaskState - Parse TODO(t) into state and shortcut key {{{1
7 function! vimtodo#TodoParseTaskState(state)
8 let state=matchstr(a:state, '^[A-Z]\+')
9 let key=matchstr(a:state, '\(^[A-Z]\+(\)\@<=[a-zA-Z0-9]\()\)\@=')
10 return { "state": state, "key": key }
15 " Set - setup script variables {{{1
16 function! vimtodo#Set(varname, value)
18 exec "let" a:varname "=" string(a:value)
23 " Default variables {{{1
24 function! vimtodo#SetDefaultVars()
25 call vimtodo#Set("g:todo_states",
26 \[["TODO(t)", "|", "DONE(d)", "CANCELLED(c)"],
27 \["WAITING(w)", "CLOSED(l)"]])
28 call vimtodo#Set("g:todo_state_colors", { "TODO" : "Blue", "DONE": "Green",
29 \ "CANCELLED" : "Red", "WAITING": "Yellow", "CLOSED": "Grey" })
30 call vimtodo#Set("g:todo_checkbox_states", [[" ", "X"], ["+", "-", "."],
32 call vimtodo#Set("g:todo_log_done", 1)
33 call vimtodo#Set("g:todo_log_into_drawer", "LOGBOOK")
34 call vimtodo#Set("g:todo_done_file", "done.txt")