Autocommit of file /home/julien/.dotfiles/vim/.vim/bundle/vimtodo/autoload/vimtodo...
[dotfiles/vim.git] / .vim / bundle / vimtodo / autoload / vimtodo.vim
1 " Vim filetype plugin for heirarchical TODO lists
2 " Maintainer:   Mark Harrison <mark@mivok.net>
3 " License:      ISC - See LICENSE file for details
4
5 " Utility functions
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 }
11 endfunction
12 "1}}}
13
14 " Default settings
15 " Set - setup script variables {{{1
16 function! vimtodo#Set(varname, value)
17     if !exists(a:varname)
18         exec "let" a:varname "=" string(a:value)
19     endif
20 endfunction
21 "1}}}
22
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"], ["+", "-", "."],
31         \["Y", "N", "?"]])
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")
35 endfunction
36 "1}}}