Skip to content

Instantly share code, notes, and snippets.

@kemitchell
Created January 29, 2013 06:08
Show Gist options
  • Save kemitchell/4662187 to your computer and use it in GitHub Desktop.
Save kemitchell/4662187 to your computer and use it in GitHub Desktop.
" Vim syntax file
" Language: Precedent
" Filenames: *.pre
" OriginalAuthor: Kyle Mitchell <kyle@blackacrelabs.org>
" Version: 0.0.1
if exists("b:current_syntax")
finish
endif
syntax clear
syntax case ignore
syntax keyword precedentCitations supra
syntax region precedentIndentedPar start='/^ [^\s]/' end='/\n\n/'
syntax match precedentStatutes '\d\+ U\. S\. C\. \d+'
syn region precedentHeading start='^#\+' end='\n'
hi link precedentHeading Special
syn match precedentHeading '^\* \* \*'
hi link precedentHeading Special
syn match precedentNonBreakingSpace ' '
hi link precedentNonBreakingSpace Error
syn region precedentItalic start='\\\\' end='\\\\'
hi Italic term=underline, cterm=underline, gui=underline
hi link precedentItalic Italic
syn match precedentPageBreak '@@\d\+@@'
hi link precedentPageBreak Type
syn match precedentFootnoteMarker '^\^\([0-9]\+|\*|†|‡\) '
hi link precedentFootnoteMarker Type
syn region precedentCitation start='{{' end='}}'
hi Underlined term=underline, cterm=underline, gui=underline
hi link precedentCitation Comment
syn region precedentSmallCaps start='<<' end='>>'
syn match precedentTerminalSpace "[[:space:]]\+$"
hi link precedentTerminalSpace Error
syn match precedentBadIndent "^ [^[:space:]]"
hi link precedentBadIndent Error
syntax match precedentMeta '^[A-Z]\w\+: .\+\n'
hi link precedentMeta PreProc
syn match precedentFootnoteMarker '^\^\d\+'
hi link precedentFootnoteMarker Statement
hi link precedentKeywords Keyword
hi link precedentReporters Keyword
hi link precedentStatutes Keyword
hi link precedentCitations Keyword
let b:current_syntax = "precedent"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment