#!/bin/sed -f # # DEDICATED TO THE PUBLIC DOMAIN # # Colorize vimoutliner OTL files # # Attribute codes: # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed # Text color codes: # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan # 37=white # Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan # 47=white # # Construct substitution rules like so: # # # Highlight PATTERN in bold read on white background # s/pattern/&/g # # ALWAYS remember to close with the normal tag # # Replace tabs w/4 spaces s/ / /g # Checkboxes are in bold yellow, completed in normal yellow s/\[[X_]\]/&/g s/\[[_]\]/&/g # Context is delimited by @CONTEXT:, highlight this in red s/[[:space:]]@[[:graph:]]\+:/&/g # Percent complete notation s/[[:space:]][0-9]\{0,2\}%/&/g # Comments are in bold cyan s/#.*$/&/g # Text blocks are delimited by ':' and are green, regardless of level s/^[[:blank:]]*:.*$/&/g # URI's are in magenta s,[[:alnum:]]\+://[-_.+a-zA-Z0-9/%]\+,&,g s,\(mailto:\)*[-_.+a-zA-Z0-9]\+@[-_.+a-zA-Z0-9]\+,&,g # Repeating Lines in magenta s@[-_=*]\{3,\}@&@g # Lines w/text at the beginning in white s/^[[:alnum:]]\+.*$/&/g