robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
14d653b421
master
1" Maintainer: Anmol Sethi <hi@nhooyr.io> 2" Previous Maintainer: SungHyun Nam <goweol@gmail.com> 3 4if exists ( 'b:current_syntax' ) 5finish 6endif 7 8syntax case ignore 9syntax match manReference display '[ ^()[:space: ] ]\+(\%( [ 0-9 ][ a-z ] * \| [ nlpox ] \)) ' 10syntax match manSectionHeading display '^\S. * $ ' 11syntax match manHeader display '^\%1l. * $ ' 12syntax match manSubHeading display '^ \{3\}\S. * $ ' 13syntax match manOptionDesc display '^\s\+\(\%(+\|-\)\S\+,\s\+\) * \%(+\|-\)\S\+ ' 14 15highlight default link manHeader Title 16highlight default link manSectionHeading Statement 17highlight default link manOptionDesc Constant 18highlight default link manReference PreProc 19highlight default link manSubHeading Function 20 21highlight default manUnderline cterm = underline gui = underline 22highlight default manBold cterm = bold gui = bold 23highlight default manItalic cterm = italic gui = italic 24 25if & filetype != 'man' 26" May have been included by some other filetype. 27finish 28endif 29 30if get ( b:, 'man_sect' , '' ) =~# '^[023]' 31syntax case match 32syntax include @c $VIMRUNTIME/syntax/c.vim 33syntax match manCFuncDefinition display '\<\h\w * \>\ze\(\s\|\n\) * ( 'contained 34syntax match manLowerSentence /\n\s\{7}\l.\+ [ () ] \=\%(\:\|.\|-\) [ () ] \= [ {}; ] \@<!\n$ /display keepend contained contains = manReference 35syntax region manSentence start = /^\s\{7}\%(\u\|\*\) [ ^{}= ] * /end = /\n$ /end = /\ze\n\s\{3,7}# /keepend contained contains = manReference 36syntax region manSynopsis start = '^\%( 37\SYNOPSIS\| 38\SYNTAX\| 39\SINTASSI\| 40\SKŁADNIA\| 41\СИНТАКСИС\| 42\書式\)$ 'end = '^\%(\S. * \)\=\S$ 'keepend contains = manLowerSentence , manSentence , manSectionHeading , @c , manCFuncDefinition 43highlight default link manCFuncDefinition Function 44 45syntax region manExample start = '^EXAMPLES\=$ 'end = '^\%(\S. * \)\=\S$ 'keepend contains = manLowerSentence , manSentence , manSectionHeading , manSubHeading , @c , manCFuncDefinition 46 47" XXX: groupthere doesn't seem to work 48syntax sync minlines= 500 49"syntax sync match manSyncExample groupthere manExample '^EXAMPLES\=$' 50"syntax sync match manSyncExample groupthere NONE '^\%(EXAMPLES\=\)\@!\%(\S.*\)\=\S$' 51endif 52 53" Prevent everything else from matching the last line 54execute 'syntax match manFooter display "^\%' . line ( '$' ) . 'l.*$"' 55 56let b: current_syntax = 'man'