diff options
| author | David Kaufmann <astra@ionic.at> | 2018-09-10 15:26:51 +0200 |
|---|---|---|
| committer | David Kaufmann <astra@ionic.at> | 2018-09-10 15:26:51 +0200 |
| commit | 60c4c9361f599d22395b25155327afad2a4dac06 (patch) | |
| tree | fddc43c3e65a7b78e75e6878e5a91a2086950e4d | |
| parent | bb4cbe42a17bec2763942e164afb6e354160330e (diff) | |
| download | config-60c4c9361f599d22395b25155327afad2a4dac06.tar.gz | |
Revert "update vim todo plugin"
This reverts commit 709ed9b8cf11dbf28672f81d63b77729368fe4d4.
| -rw-r--r-- | home/.vim/ftdetect/filetype.vim | 3 | ||||
| -rw-r--r-- | home/.vim/sample/sample.txt | 31 | ||||
| -rwxr-xr-x | home/.vim/scripts.vim | 4 | ||||
| -rw-r--r-- | home/.vim/syntax/todo.vim | 126 | ||||
| -rwxr-xr-x | home/.vim/todo/sample.todo | 23 | ||||
| -rwxr-xr-x | home/.vim/todo/sample.txt | 8 |
6 files changed, 99 insertions, 96 deletions
diff --git a/home/.vim/ftdetect/filetype.vim b/home/.vim/ftdetect/filetype.vim deleted file mode 100644 index 0171463..0000000 --- a/home/.vim/ftdetect/filetype.vim +++ /dev/null @@ -1,3 +0,0 @@ -augroup filetypedetect - au BufRead,BufNewFile *.todo,*_todo.txt setfiletype todo -augroup END diff --git a/home/.vim/sample/sample.txt b/home/.vim/sample/sample.txt deleted file mode 100644 index 48f5891..0000000 --- a/home/.vim/sample/sample.txt +++ /dev/null @@ -1,31 +0,0 @@ -#todo - -Any text file whose name ends with '.todo' or with '_todo.txt, -or whose first 100 lines contains '#todo' is a 'todo' file. - -A Header starts in column 1 with an upper-case letter and ends with a colon: - - A sub-header is any indented header line: - - + This is a high pri item, indicated by a '+' at the start. - o This is a medium priority item, indicated by 'o'. - - Low pri items start with a '-'. - - + A completed item:done - D Another way to mark an item completed is to replace the - prefix character (+/o/-) with D. - d A partially completed item has the prefix character 'd'. - - o An ignored item:ignore - x Another way to ignore an item is to use the 'x' prefix - character. - - ? An item that is in question, needs more info, etc. - - o Entries can also contain dates like so: - <2007/12/11> - <2007-12-11> - <12/31> - <8/1> - - o Comments can be embedded [this is a comment] inside an item. diff --git a/home/.vim/scripts.vim b/home/.vim/scripts.vim index db16273..5dea2ec 100755 --- a/home/.vim/scripts.vim +++ b/home/.vim/scripts.vim @@ -1,3 +1,3 @@ -if join(getline(1,100),' ') =~? '\<#\?TODO\>' - setfiletype todo +if getline(1) =~? '^#\?TODO\>' + setfiletype todo endif diff --git a/home/.vim/syntax/todo.vim b/home/.vim/syntax/todo.vim index f244c32..1fd11bd 100644 --- a/home/.vim/syntax/todo.vim +++ b/home/.vim/syntax/todo.vim @@ -1,80 +1,86 @@ +" Vim script to set syntax highlighting for a todo list. + +" A todo list is recognized by file names of the form *.todo, +" OR files that contain #todo as the first line of a file, +" OR files with modelines that contain ft=todo + +" Header lines - Lines starting at column 0. +" Normal priority items - Non-header lines that start with a 'o'. +" High priority items - .... with a '+'. +" Low priority items - .... with a '-'. +" Items completed - ... with a 'd' or 'D'. +" Items ignored - ... with a 'x' or 'X'. +" Dates - Digits (and / and -) enclosed by < and >. +" Comments - Stuff enclosed in '[' and ']' or any line +" that is none of the above. + +" See the file test.todo for sample entries. + +" Author: Suresh S. +" Version: 0.2 + + if exists("b:current_syntax") finish endif -" Vim script to set syntax highlighting for a todo list. -" See README.txt and sample.txt for description and examples. -" Version: 0.4 -" -" Author: Suresh S. +syn case ignore -syn match todoDate "<\?\d\{1,4}\([-/:]\d\{1,4\}\)\{1,3\}>\?" +" Dates can also be embedded. +" N/N/N or N-N-N or N/N or N-N. +syn match todoDate "<\(\(\d\{1,4\}[-/]\)\?\d\{1,2\}[-/]\d\{1,4\}\)>" contained -" Comments embedded in todo items, inside []. -syn region todoComment start="\[" end="\]" contained +" Comments embedded in todo items. +syn region todoComment start="\["hs=s+1 end="\]"he=e-1 contained contains=todoDate " Header lines to start sections. -syn match todoHeader1 "^\([0-9].*\s\s*\)\?[A-Z].*:$" contains=todoDate -syn match todoHeader2 "^\_\s\+\zs\([0-9].*\s\s*\)\?[A-Z].*:$" contains=todoDate - -syn case ignore +syn match todoHeader1 "^\(\(\<[odxi\?]\s\)\@<!.\)*:$" contains=todoDate +syn match todoHeader2 "^\s\s*\(\([odxi\?]\s\)\@<!.\)*:$" contains=todoDate " Normal priority items. -syn region todoNormalPri start="\(^\s*\)\@<=o\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend +syn region todoNormalPri start="\(^\s*\)\@<=o\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend " High priority items. -syn region todoHiPri start="\(^\s*\)\@<=+\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend -" Low priority items. -syn region todoLowPri start="\(^\s*\)\@<=-\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend +syn region todoHiPri start="\(^\s*\)\@<=+\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend +" Low pri +syn region todoLowPri start="\(^\s*\)\@<=-\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend " Unprioritized items. -syn region todoNoPri start="\(^\s*\)\@<=\*\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend -" Questions. -syn match todoQuestion "\(^\s*\)\@<=?\s" contains=todoComment -syn case match - +syn region todoQuestion start="\(^\s*\)\@<=?\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend " Items completed. -syn region todoHalfDone start="\(^\s*\)\@<=d\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend -syn region todoDone start="\(^\s*\)\@<=D\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend - -syn case ignore +syn region todoDone start="\(^\s*\)\@<=d\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend " Items ignored/won't do. -syn region todoIgnore start="\(^\s*\)\@<=[xiXI]\s" end="\(^\s*[o\-+?dxiDXI]\s\|\n\n\+\)"he=s-1,me=s-1 contains=todoDate,todoComment keepend +syn region todoIgnore start="\(^\s*\)\@<=[xi]\s" end="\(^\s*[o\-+?dxi]\s\|\n\n\+\)"he=s-1,me=s-1 contains=CONTAINED keepend -" TODO: Fix this to handle multi-line items. -syn match todoIgnore "\(^\s*\)\@<=[o+\-?].*:\(ignore\|ign\)$" contains=todoDate,todoComment -syn match todoDone "\(^\s*\)\@<=[o+\-?].*:\(done\|don\)$" contains=todoDate,todoComment -syn match todoHalfDone "\(^\s*\)\@<=[o+\-?].*:\(incomplete\|inc\)$" contains=todoDate,todoComment +" Fix this to handle multi-line items. +syn match todoIgnore "\(^\s*\)\@<=[o+\-?].*:ignore$" contains=CONTAINED +syn match todoDone "\(^\s*\)\@<=[o+\-?].*:done$" contains=CONTAINED syn case match -"-------------------------------------------------------------------- +"-------------------------------------------------------------------------- " Colors and effects. -"-------------------------------------------------------------------- -function! SetToDoColors() - hi todoHeader1 gui=bold,underline - hi todoHeader2 gui=undercurl - if &background == "dark" - hi def todoHiPri guifg=Red - hi def todoNormalPri guifg=Orange gui=bold - hi def todoLowPri guifg=Yellow - hi def todoDate guifg=LightCyan gui=bold - hi def todoDone guifg=Green - hi def todoHalfDone guifg=LightGreen - hi def todoComment gui=italic - hi def todoIgnore guifg=Gray80 - else - hi def todoHiPri guifg=Red gui=bold - hi def todoNormalPri guifg=DarkOrange gui=bold - hi def todoLowPri guifg=Brown gui=bold - hi def todoDate guifg=Blue gui=bold - hi def todoDone guifg=Green gui=bold - hi def todoHalfDone guifg=LightGreen gui=bold - hi def todoComment gui=italic - hi def todoIgnore guifg=Gray40 gui=bold - endif - hi link todoQuestion TODO -endfunction -augroup TodoHLGroup - autocmd! ColorScheme * call SetToDoColors() -augroup END -call SetToDoColors() +"-------------------------------------------------------------------------- + +hi todoHeader1 cterm=bold + +" Uncomment the following line if sub-headers should appear in bold: +" hi todoHeader2 gui=bold + +hi link todoQuestion Todo +hi todoHiPri ctermfg=Red +hi todoNormalPri ctermfg=Yellow +hi todoDone ctermfg=Green +hi todoComment cterm=Italic + +if &background == "dark" + hi todoLowPri ctermfg=LightCyan + hi todoIgnore ctermfg=Gray + hi todoDate ctermfg=LightCyan cterm=bold +else + hi todoLowPri ctermfg=Blue + hi todoIgnore ctermfg=Gray + hi todoDate ctermfg=Blue cterm=bold +endif + let b:current_syntax = "todo" + +" vim: ts=18 diff --git a/home/.vim/todo/sample.todo b/home/.vim/todo/sample.todo new file mode 100755 index 0000000..5b2c38a --- /dev/null +++ b/home/.vim/todo/sample.todo @@ -0,0 +1,23 @@ + +A Header line ends with a colon: + + A sub-header is like a header, but is indented: + ++ This is a high pri item, indicated by a '+' at the start. +o This is a medium priority item, indicated by 'o'. +- Low pri items start with a '-'. + ++ A high pri completed item is suffixed by ':done', like so:done +d Changing the prefix to 'd' does the same, if we don't care about preserving the priority info. +o An item that ends with ':ignore' is an ignored item :ignore +x Another way to say the same thing. + +? An item that is in question, needs more info, etc. + +o Entries can also contain a date like so: <2007/12/11>, +or even multiple dates: do this by <2007-12-11>, or at the latest b<12/31>. + o Or so: <8/1> + + o Comments can be embedded [this is a comment] inside an item. + [Comments can also contain a date <99/99/99>]. + diff --git a/home/.vim/todo/sample.txt b/home/.vim/todo/sample.txt new file mode 100755 index 0000000..cbd41cf --- /dev/null +++ b/home/.vim/todo/sample.txt @@ -0,0 +1,8 @@ +#todo + +Any file whose first line starts with #todo is a 'todo' file: + +o This is a normal todo. +D This is done +X Ignored +? Question. |
