vim-schemer

Vim plugin to make writing colorschemes easier by providing a clean slate, and using a simpler/more readable syntax.
git clone git://git.alex.balgavy.eu:vim-schemer.git
Log | Files | Refs | README | LICENSE

schemer.vim (1836B)


      1 " Quit when a (custom) syntax file was already loaded
      2 if exists("b:current_syntax")
      3   finish
      4 endif
      5 
      6 let s:cpo_save = &cpo
      7 set cpo&vim
      8 
      9 " Clear the syntax
     10 syntax clear
     11 
     12 " Define highlighting groups
     13 syntax keyword schemerKeyword background light dark ansi
     14 syntax keyword schemerNone NONE
     15 syntax keyword schemerAttrs italic bold inverse underline undercurl strikethrough reverse standout
     16 syntax match schemerGroup "^[A-Z][^ ]*"
     17 syntax match schemerName "[ ,]\zs[^# ][^ ]*"
     18 syntax match schemerColor "#[0-9a-fA-F]\+"
     19 syntax match schemerDelims "[,.]" containedin=schemerLinkSource
     20 syntax match schemerLinkLine "^link .*$" contains=schemerLink,schemerLinkSource,schemerLinkDest
     21 syntax keyword schemerLink contained link
     22 syntax match schemerLinkSource "\(link \)\@<= *[a-zA-Z,]\+" contained
     23 syntax match schemerLinkDest "[a-zA-Z]\+$" contained
     24 syntax region schemerComment start=/^ *"/ end="$"
     25 syntax region schemerPalette start="^palette:" end="\." contains=schemerPaletteKeyword,schemerPaletteColorName,schemerPaletteColorVal,schemerComment
     26 syntax match schemerPaletteColorName "^ *\zs[^ ]\+" contained
     27 syntax match schemerPaletteColorVal "#[a-fA-F0-9]\+" contained
     28 syntax keyword schemerPaletteKeyword palette contained
     29 
     30 " Perform the actual highlighting
     31 hi def link schemerKeyword Include
     32 hi def link schemerGroup Statement
     33 hi def link schemerLinkSource Statement
     34 hi def link schemerColor Constant
     35 hi def link schemerNone Include
     36 hi def link schemerDelims Delimiter
     37 hi def link schemerAttrs String
     38 hi def link schemerLink Operator
     39 hi def link schemerLinkDest Identifier
     40 hi def link schemerComment Comment
     41 hi def link schemerPaletteColorName Number
     42 hi def link schemerPaletteColorVal Constant
     43 hi def link schemerPaletteKeyword Include
     44 hi def link schemerName Number
     45 
     46 let b:current_syntax = "schemer"
     47 let &cpo = s:cpo_save
     48 unlet s:cpo_save