Skip to content

Instantly share code, notes, and snippets.

@lewdlime
Created November 12, 2012 17:32
Show Gist options
  • Save lewdlime/4060708 to your computer and use it in GitHub Desktop.
Save lewdlime/4060708 to your computer and use it in GitHub Desktop.
abcvim-gist
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
*.ctxt
# OS generated files #
######################
~*.*
*.DS_Store
*.DS_Store?
*.swp
*.swo
*._*
*.Spotlight-V100
*.Trashes
Icon?
ehthumbs.db
Thumbs.db
; BNF for abc music notation
" Abc Code Constructs
syn match abcOperator '[#$&-/;-@\[-`{}~]' contained
syn match abcString /"[^"%]*"/ contained contains=abcSpecialChar
syn match abcRest /[xz][1-9]*\d*\/*/ contained
syn match abcRest /[xz][1-9]*\d*\%(\/[1-9]*\d*\)\=/ contained
syn match abcSpacer /[yY]\d*\.\d\+/ contained
syn match abcNote /[=_^]\{,2}[a-gA-G][,']*[1-9]*\d*\/*/ contained
syn match abcNote /[=_^]\{,2}[a-gA-G][,']*[1-9]*\d*\%(\/[1-9]*\d*\)\=/ contained
syn match abcBar /[:|][:|]/ contained
syn match abcBar /[|\[\]]\%([1-9]\%([,-]\d\)*\)\=/ contained
syn match abcBar /:\+[|\[\]]\%([1-9]\%([,-]\d\)*\)\=/ contained
syn match abcTuple /([1-9]\d*\%(:\d*\)\{,2}/ contained
syn match abcMacro /~\w\{2,31}/ contained
syn region abcChord matchgroup=abcOperator start=/\[\(\a:\)\@!/ skip=/[^%\]]*/ end=/\]/ keepend contained transparent contains=abcOperator,abcRest,abcSpacer,abcNote
syn region abcGrace matchgroup=abcOperator start=/{\/\=/ skip=/[^}]*/ end=/}/ keepend contained transparent contains=abcOperator,abcRest,abcSpacer,abcNote
syn region abcSlur matchgroup=abcOperator start=/(\d\@!/ skip=/[^)]*/ end=/)/ keepend contained transparent contains=@abcCode
syn match abcSymbol /![<>.+[:alnum:]]*[()]\=!/ contained
syn cluster abcCode contains=abcOperator,abcString,abcRest,abcSpacer,abcNote,abcBar,abcTuple,abcMacro,abcChord,abcGrace,abcSlur,abcSymbol
" Directives
syn match abcDirective '%%.*'
" Keywords {{{
"syn keyword abcPreProcKeyword contained nextgroup=abcDefine skipwhite abc2pscompat alignbars aligncomposer annotationfont autoclef barnumbers barsperstaff breakoneoln bgcolor botmargin bstemdown cancelkey comball combinevoices composerfont composerspace contbarnb continueall custos dateformat deco decoration dynalign dynamic encoding flatbeams font footer footerfont format gchord gchordbox gchordfont graceslurs gracespace gstemdir header headerfont historyfont hyphencont indent infofont infoline infoname infospace landscape leftmargin linebreak lineskipfac linewarn maxshrink maxstaffsep maxsysstaffsep measurebox measurefirst measurefont measurenb micronewps musiconly musicspace notespacingfactor oneperpage ornament pageheight pagewidth pango parskipfac partsbox partsfont partsspace pdfmark postscript repeatfont rightmargin scale setdefl setfont-1 setfont-2 setfont-3 setfont-4 shiftunisson slurheight splittune squarebreve staffnonote staffsep staffwidth stemdir stemheight straightflags stretchlast stretchstaff subtitlefont subtitlespace sysstaffsep tempofont textfont textspace timewarn titlecaps titlefont titleformat titleleft titlespace titletrim topmargin topspace tuplets vocal vocalabove vocalfont vocalspace voicefont volume wordsfont wordsspace writefields
syn region abcTypeSet matchgroup=abcTypeSetKeyword start='%%text' excludenl end='\_$' contains=abcFontOperator oneline
syn region abcTypeSet matchgroup=abcTypeSetKeyword start='%%center' excludenl end='\_$' contains=abcFontOperator oneline
syn region abcTypeSet matchgroup=abcTypeSetKeyword start='%%begintext' skip='^\%(%%\)\=.*' end='%%endtext' fold keepend
" }}}
syn region abcPS matchgroup=abcTypeSetKeyword start='%%beginps' end='%%endps' fold keepend contains=@PS
syn match abcFieldIdentifier /^\a:/ contained
syn match abcContinueIdentifier /^+:/ contained
syn match abcKeyField contained /^K:.*$/ contains=abcFieldIdentifier,abcFieldString
syn match abcTitleField contained /^T:.$/ contains=abcFieldIdentifier,abcFieldString
syn match abcTuneIDField contained /^X:.*$/ contains=abcFieldIdentifier,abcFieldString
syn region abcContinueField contained matchgroup=abcFieldIdentifier start=/\_^+:/ skip=/\\%/ matchgroup=NONE excludenl end=/$/ contains=abcComment,abcPreProc nextgroup=abcFieldContinue skipnl
syn region abcFieldContinue matchgroup=abcFieldIdentifier start=/\_^+:/ skip=/\\%/ matchgroup=NONE excludenl end=/$/ contains=abcComment,abcPreProc nextgroup=abcFieldContinue skipnl contained
syn region abcField matchgroup=abcFieldIdentifier.* start=/\_^[\a+]:/ skip=/\\%/ matchgroup=NONE excludenl end=/$/ contains=abcComment,abcPreProc nextgroup=abcFieldContinue skipnl
syn region abcTuneHeaderField matchgroup=abcFieldIdentifier start=/\_^[A-DF-IL-SUVWZmr]:/ skip=/\\%/ matchgroup=NONE excludenl end=/$/ contains=abcComment,abcPreProc nextgroup=abcFieldContinue skipnl contained
syn region abcFileHeaderField matchgroup=abcFieldIdentifier start=/\_^[A-DF-IL-SUVWZmr]:/ skip=/\\%/ matchgroup=NONE excludenl end=/$/ contains=abcComment,abcPreProc nextgroup=abcFieldContinue skipnl contained
" Highlighting {{{
if version >= 508 || !exists('did_abc_syn_inits')
if version < 508
let did_abc_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
hi Error term=standout,bold cterm=standout,bold ctermfg=white ctermbg=red gui=standout,bold guifg=white guibg=red
hi Todo term=standout cterm=standout ctermfg=black ctermbg=yellow gui=standout guifg=black guibg=yellow
hi Comment term=italic cterm=italic ctermfg=darkgreen ctermbg=bg gui=italic guifg=darkgreen guibg=bg
hi SpecialChar term=underline cterm=bold ctermfg=magenta ctermbg=bg gui=bold guifg=magenta guibg=bg
hi Operator term=bold cterm=bold ctermfg=darkcyan ctermbg=bg gui=bold guifg=DodgerBlue guibg=bg
hi String term=italic cterm=italic ctermfg=green ctermbg=bg gui=italic guifg=green guibg=bg
hi Statement term=underline,bold cterm=bold ctermfg=lightcyan ctermbg=bg gui=bold guifg=LightSeaGreen guibg=bg
hi Constant term=underline,bold cterm=bold ctermfg=darkyellow ctermbg=bg gui=bold guifg=ForestGreen guibg=bg
hi Delimiter term=bold cterm=bold ctermfg=darkyellow ctermbg=bg gui=bold guifg=orange guibg=bg
hi Macro term=none cterm=none ctermfg=darkmagenta ctermbg=bg gui=none guifg=DarkViolet guibg=bg
hi Type term=none cterm=none ctermfg=lightred ctermbg=bg gui=none guifg=firebrick guibg=bg
hi SpecialComment term=bold cterm=bold ctermfg=magenta ctermbg=bg gui=bold guifg=magenta guibg=bg
hi PreProc term=bold cterm=bold ctermfg=magenta ctermbg=bg gui=bold guifg=magenta
hi Identifier term=none cterm=bold ctermfg=lightgreen ctermbg=bg gui=bold guifg=LimeGreen guibg=bg
hi Special term=none cterm=none ctermfg=cyan ctermbg=bg gui=bold guifg=cyan guibg=bg
HiLink abcError Error
HiLink abcTodo Todo
HiLink abcNormal Normal
HiLink abcSpecialChar SpecialChar
HiLink abcOperator Operator
HiLink abcString String
HiLink abcRest Statement
HiLink abcSpacer Statement
HiLink abcNote Constant
HiLink abcBar Delimiter
HiLink abcTuple Operator
HiLink abcMacro Macro
HiLink abcSymbol Type
HiLink abcComment Comment
HiLink abcSpecialComment SpecialComment
HiLink abcDirective PreProc
HiLink abcFieldIdentifier Identifier
HiLink abcFieldString String
HiLink abcInlineString String
HiLink abcInlineField Special
delcommand HiLink
endif
" SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B sRGB HSB
" --------- ------- ---- ------- ----------- ---------- ----------- -----------
" base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
" base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
" base01 #586e75 10/7 brgreen 240 #4e4e4e 45 -07 -07 88 110 117 194 25 46
" base00 #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195 23 51
" base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
" base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
" base2 #eee8d5 7/7 white 254 #d7d7af 92 -00 10 238 232 213 44 11 93
" base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
" yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71
" orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80
" red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86
" magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83
" violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77
" blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
" cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
" green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60
" Syncing {{{
syn sync ccomment abcComment
syn sync linecont /\\$/
syn sync match abcTypesetSync grouphere abcTypeset /%%begin\I\i*/
syn sync match abcTypesetSync groupthere abcTypeset /%%end\I\i*/
syn sync match abcOperatorSync '[#$&-/;-@\[-`{}~]'
syn sync match abcBarSync /[:|][:|]/
syn sync match abcBarSync /[|\[\]]\%([1-9]\%([,-]\d\)*\)\=/
syn sync match abcBarSync /:*[|\[\]]\%([1-9]\%([,-]\d\)*\)\=/
syn sync match abcTuple /([1-9]\d*\%(:\d*\)\{,2}/
syn sync match abcChordSync grouphere abcChord /\[\(\a:\)\@!/
syn sync match abcChordSync groupthere abcChord /\]/
syn sync match abcGraceSync grouphere abcGrace /{/
syn sync match abcGraceSync groupthere abcGrace /}/
syn sync match abcSlurSync grouphere abcSlur /(\d\@!/
syn sync match abcSlurSync groupthere abcSlur /)/
syn sync match abcInlineFieldSync grouphere abcInlineField /\[\a:/
syn sync match abcInlineFieldSync groupthere abcInlineField /\]/
syn sync match abcFieldSync grouphere abcFileField /^[A-DF-IL-ORSUZmr]:/
syn sync match abcFieldSync grouphere abcHeaderField /^[A-DF-IK-TVWXZmr]:/
syn sync match abcFieldSync grouphere abcBodyField /^[IK-NP-RTU-Wmrsw]:/
syn sync match abcFieldSync groupthere NONE /$/
syn sync match abcTuneHeaderSync grouphere abcTuneHeader /^X:/
syn sync match abcTuneHeaderSync groupthere abcTuneHeader /^K:.*$/
syn sync match abcTuneSync grouphere abcTune /^X:/
syn sync match abcTuneSync groupthere NONE /^\s*$/
syn sync match abcFileHeaderSync grouphere abcFileHeader /\%^%abc/
syn sync match abcFileHeaderSync groupthere NONE /^\s*$/
" }}}
" Toplevel
syn region abcTuneHeader matchgroup=abcHeaderField start=/^X:/ end=/^K:.*$/ keepend transparent contained contains=abcHeaderField,abcDirective,abcComment,abcTypeset
syn region abcTune matchgroup=abcTuneHeader start=/^X:/ matchgroup=NONE end=/^\s*$/ keepend transparent contains=@abcCode,abcBodyField,abcInlineField,abcComment,abcDirective,abcTypeset
syn match abcComment /%.*$/ extend
syn match abcSpecialComment /^%abc\%(-\d\.\d\)\=/ contained
syn match abcDirective /%%.*$/ extend
syn region abcFileHeader matchgroup=abcSpecialComment start=/\%^\%(%abc\%(-[1-9]\.\d\)\=\)\=/ matchgroup=NONE end=/^\s*$/ keepend transparent contains=abcFileField,abcDirective,abcComment,abcTypeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment