From 60c4c9361f599d22395b25155327afad2a4dac06 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Mon, 10 Sep 2018 15:26:51 +0200 Subject: Revert "update vim todo plugin" This reverts commit 709ed9b8cf11dbf28672f81d63b77729368fe4d4. --- home/.vim/ftdetect/filetype.vim | 3 - home/.vim/sample/sample.txt | 31 ---------- home/.vim/scripts.vim | 4 +- home/.vim/syntax/todo.vim | 126 +++++++++++++++++++++------------------- home/.vim/todo/sample.todo | 23 ++++++++ home/.vim/todo/sample.txt | 8 +++ 6 files changed, 99 insertions(+), 96 deletions(-) delete mode 100644 home/.vim/ftdetect/filetype.vim delete mode 100644 home/.vim/sample/sample.txt create mode 100755 home/.vim/todo/sample.todo create mode 100755 home/.vim/todo/sample.txt (limited to 'home') 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\)\@, +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. -- cgit v1.2.3