vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

haredoc.vim (1122B)


      1 vim9script
      2 
      3 # Vim syntax file.
      4 # Language:    Haredoc (Hare documentation format)
      5 # Maintainer:  Amelia Clarke <selene@perilune.dev>
      6 # Last Change: 2026 Jan 24
      7 # Upstream:    https://git.sr.ht/~sircmpwn/hare.vim
      8 
      9 if exists('b:current_syntax')
     10   finish
     11 endif
     12 
     13 # Syntax {{{1
     14 syn case match
     15 syn iskeyword @,48-57,_
     16 
     17 # Embedded code samples.
     18 syn region haredocCode excludenl start='\v%(^\s*\t)@<=' end='$' contains=@NoSpell display
     19 
     20 # References to other declarations and modules.
     21 syn match haredocSpecial '\v\[\[\h\w*%(::\h\w*)*%(::)?]]' contains=@NoSpell display
     22 
     23 # Miscellaneous.
     24 syn keyword haredocTodo FIXME TODO XXX
     25 
     26 # Default highlighting {{{1
     27 hi def link haredocCode Comment
     28 hi def link haredocSpecial Special
     29 hi def link haredocTodo Todo
     30 
     31 # Highlight incorrect whitespace by default.
     32 syn match haredocSpaceError excludenl '\s\+$' containedin=ALL display
     33 syn match haredocSpaceError '.\zs \+\ze\t' containedin=ALL display
     34 if get(g:, 'hare_space_error', 1)
     35   hi! def link haredocSpaceError Error
     36 else
     37   hi! def link haredocSpaceError NONE
     38 endif
     39 
     40 b:current_syntax = 'haredoc'
     41 
     42 # vim: fdm=marker et sts=2 sw=2 ts=8 tw=80