#!/bin/sed -f # # DEDICATED TO THE PUBLIC DOMAIN # # Colorize vimoutliner OTL files closely to vim's syntax highlighting # # 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 # # VIM's syntax highlighting for OTL only does colors based on tab depth # # Change tabs to four spaces. Edit to your liking. s/ / /g # Text blocks are delimited by '[:space:]:' and are green, regardless of rank s/^[[:blank:]]*:.*$/&/g # First rank: bold white s/^[[:graph:]].*$/&/g # Second rank: bold red s/^ \{4,4\}[[:graph:]].*$/&/g # Third rank: bold blue s/^ \{8,8\}[[:graph:]].*$/&/g # Fourth rank: bold magenta s/^ \{12,12\}[[:graph:]].*$/&/g # Fifth rank: bold white s/^ \{16,16\}[[:graph:]].*$/&/g # Sixth rank: bold red s/^ \{20,20\}[[:graph:]].*$/&/g # Seventh rank: bold blue s/^ \{24,24\}[[:graph:]].*$/&/g # Eighth rank: bold magenta s/^ \{28,28\}[[:graph:]].*$/&/g