Last active
August 29, 2022 18:28
-
-
Save vreon/1260002 to your computer and use it in GitHub Desktop.
TODO syntax highlighting for vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
todo () { | |
if [ "$1" = "-g" ]; then | |
path=$HOME | |
else | |
path=$(pwd) | |
while [[ "$path" != "" && ! -e "$path/TODO" ]]; do | |
path=${path%/*} | |
done | |
[ -z "$path" ] && path=$HOME | |
fi | |
$EDITOR "$path/TODO" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
au BufRead,BufNewFile TODO,*.TODO,*.todo set filetype=todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Types of items | |
- Task | |
x Completed | |
> In progress | |
- Something I should investigate? | |
- Something important! | |
. Something to keep in mind | |
Example list of things to do | |
x Have some coffee | |
x Call Mom | |
- Go grocery shopping | |
- Milk | |
- Which brand? | |
- Don't get skim milk! Ew. | |
- Eggs (dozen) | |
- Bread | |
. The potato bread I got last time was really good | |
x Post TODO syntax file as gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: TODO | |
" Last Change: 2012-07-25 | |
" Author: Jesse Dubay <[email protected]> | |
" Version: 0.3.0 | |
if exists("b:current_syntax") | |
finish | |
endif | |
syn match todoTopLevel /^[^x\- ].*$/ | |
syn match todoHeaderDelim /^[\-\=]*$/ | |
syn match todoLineItem /^\s*[\-\*] .*$/ | |
syn match todoDoneItem /^\s*x .*$/ | |
syn match todoImportantItem /^\s*! .*$/ | |
syn match todoImportantItem /^\s*[\-\*] .*!.*$/ | |
syn match todoQuestionItem /^\s*[\-\*] .*?.*$/ | |
syn match todoQuestionItem /^\s*? .*$/ | |
syn match todoNoteItem /^\s*\. .*$/ | |
syn match todoInProgressItem /^\s*> .*$/ | |
hi link todoTopLevel Function | |
hi link todoHeaderDelim Comment | |
hi link todoLineItem Normal | |
hi link todoDoneItem Comment | |
hi link todoImportantItem Title | |
hi link todoQuestionItem Special | |
hi link todoNoteItem SpecialComment | |
hi link todoInProgressItem String | |
let b:current_syntax = "todo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment