From b9ce1f8aba60c0aacf307ec961b0633a42c525ee Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Tue, 1 Nov 2011 09:08:08 +0100 Subject: [PATCH] Autocommit of file /home/julien/.dotfiles/vim/.vim/bundle/vimtodo/syntax/todo.vim changed on host ares --- .vim/bundle/vimtodo/syntax/todo.vim | 84 +++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .vim/bundle/vimtodo/syntax/todo.vim diff --git a/.vim/bundle/vimtodo/syntax/todo.vim b/.vim/bundle/vimtodo/syntax/todo.vim new file mode 100644 index 0000000..de5c38e --- /dev/null +++ b/.vim/bundle/vimtodo/syntax/todo.vim @@ -0,0 +1,84 @@ +" Vim syntax file +" Maintainer: Mark Harrison +" Last Change: Aug 15, 2009 +" License: ISC - See LICENSE file for details + +" au BufRead,BufNewFile todo.txt,*.todo.txt,recur.txt,*.todo set filetype=todo + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Load default variables if not already set +call vimtodo#SetDefaultVars() + +syn match todoProject /+\S\+/ +syn match todoContext /\s@\S\+/ +syn match todoPriority /([A-Z])/ +"syn match todoDone /^\s*\[\?[xX]\]\?\s.*/ + +syn match todoDate /\w\?{[^}]\+}[+=-]\?/ +syn match todoDate /\d\{4\}-\d\{2\}-\d\{2\}/ +syn match todoTasknum /tid\d\+/ + +syn match todoURI /\w\+:\/\/\S\+/ +syn match todoEmail /\S\+@\S\+\.\S\+/ + +syn match todoBold /\*[^*]\+\*/ +syn match todoUline /_[^_]\{2,}_/ +syn match todoComment /\s*#.*$/ +syn match todoLog /\(^\s*\)\@<=[A-Z]\+:/ +syn match todoDrawer /\(^\s*\)\@<=:[A-Z]\+:/ + +hi def link todoProject Statement +hi def link todoContext Identifier +hi def link todoPriority Special +hi def link todoDone Comment +hi def link todoDate Constant +hi def link todoTasknum Number + +hi def link todoBold PreProc +hi def link todoUline PreProc +hi def link todoComment Comment +hi def link todoLog PreProc +hi def link todoDrawer Type + +hi def link todoURI String +hi def link todoEmail String + +" Highlight state colors +function! s:HighlightStatus(name, color) + " Sets the highlight for a particular status to the given color + let name=toupper(a:name) + exe "syn match todoState".name." /\\(^\\s*\\)\\@<=".name. + \":\\?\\(\\s\\|$\\)\\@=/ contains=todoDone" + exe "hi def todoState".name." guifg=".a:color." ctermfg=".a:color. + \" gui=bold cterm=bold" +endfunction +for state in keys(g:todo_state_colors) + call s:HighlightStatus(state, g:todo_state_colors[state]) +endfor + +" Might want to make this dynamic so we can add 'contains=todoLogDONE' etc. +function! s:HighlightDone() + for group in g:todo_states + let idx = index(group, "|") + if idx != -1 + let idx = idx + 1 + elseif idx == len(group) + continue + endif + let parsed = [] + for state in group[idx+0:] + call add(parsed, vimtodo#TodoParseTaskState(state)["state"]) + endfor + let match = join(parsed, "\\|") + exec "syn region todoDone start=\"^\\z(\\s*\\)\\%(".match."\\)\\s\"". + \" end=\"^\\%(\\n*\\z1\\s\\)\\@!\"". + \" contains=todoLog" + endfor +endfunction +call s:HighlightDone() + +let b:current_syntax = "todo" -- 2.20.1