back home

This takes advantage of vim's syntax highlighting. This is all probably terribly inefficient but seems to work okay for my purposes. It does things like make dialog bright white, prose gray, and title(ish) bits and punctuation yellow. It also alerts me if I've forgotten to close a quotation, and highlights underscores (_) that I use to indicate italicized text. It even does some embedded stuff, like italics inside of a quote. I'm sure there some bugs in there, but I've fixed all the ones I've experienced.

" syn case ignore

highlight Normal ctermfg=gray

syn match Punc "[\.\,\:\;\?\!\-\[\](\. \. \.)'-]"
syn match Break "\* \* \*"
syn match Chapter "^Chapter .*$"
syn match Part "^Part .*$"
syn match Mezzo "^Intermezzo: .*$"
syn match Start "^Title: .*$"
syn match End "^THE END"
syn match Fixme "\[FIXME:.*\]"
syn match SSEndPunc "[a-z][\.\?\!][A-Z\"]"
syn match TwoFer "\c\<\(\a\+\)\_s\+\1\>"

syn region Underline start="_" end="_" contains=Punc,Twofer 
syn region HL start="+" end="+" contains=Punc,Twofer,Underline
syn region xInside matchgroup=xQuote start=/\"/ end=/\"/ contains=Underline,Punc,TwoFer,HL

hi def HL ctermfg=red
hi def Punc ctermfg=yellow
hi def Start ctermfg=yellow
hi def Underline ctermfg=cyan
hi def End ctermfg=yellow
hi def Underline ctermfg=cyan
hi def Break ctermfg=yellow
hi def Chapter ctermfg=yellow
hi def xQuoteEnd ctermfg=lightyellow
hi def Part ctermfg=blue
hi def Mezzo ctermfg=yellow
hi def xQuote ctermfg=lightyellow
hi def xQuote ctermfg=lightyellow
hi def xInside ctermfg=white
hi def Fixme ctermfg=green
hi def TwoFer ctermfg=red
hi def SSEndPunc ctermbg=red