Mercurial > vim
annotate runtime/syntax/man.vim @ 9687:a8421d842331
Added tag v7.4.2119 for changeset 8c2553beff0f783bd523754903bda32f7a71a2b5
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 29 Jul 2016 22:30:08 +0200 |
parents | 17333ebd2bbd |
children | 43efa4f5a8ea |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Man page | |
2034 | 3 " Maintainer: SungHyun Nam <goweol@gmail.com> |
7 | 4 " Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com> |
5 " Version Info: | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
6 " Last Change: 2015 Nov 24 |
7 | 7 |
8 " Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>: | |
9 " * manSubHeading | |
10 " * manSynopsis (only for sections 2 and 3) | |
11 | |
12 " For version 5.x: Clear all syntax items | |
13 " For version 6.x: Quit when a syntax file was already loaded | |
14 if version < 600 | |
15 syntax clear | |
16 elseif exists("b:current_syntax") | |
17 finish | |
18 endif | |
19 | |
20 " Get the CTRL-H syntax to handle backspaced text | |
21 if version >= 600 | |
22 runtime! syntax/ctrlh.vim | |
23 else | |
24 source <sfile>:p:h/ctrlh.vim | |
25 endif | |
26 | |
27 syn case ignore | |
28 syn match manReference "\f\+([1-9][a-z]\=)" | |
29 syn match manTitle "^\f\+([0-9]\+[a-z]\=).*" | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
30 syn match manSectionHeading "^[a-z][a-z -]*[a-z]$" |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
31 syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" |
7 | 32 syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" |
33 syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" | |
34 " syn match manHistory "^[a-z].*last change.*$" | |
35 | |
36 if getline(1) =~ '^[a-zA-Z_]\+([23])' | |
37 syntax include @cCode <sfile>:p:h/c.vim | |
38 syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained | |
1621 | 39 syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition |
7 | 40 endif |
41 | |
42 | |
43 " Define the default highlighting. | |
44 " For version 5.7 and earlier: only when not done already | |
45 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
46 if version >= 508 || !exists("did_man_syn_inits") | |
47 if version < 508 | |
48 let did_man_syn_inits = 1 | |
49 command -nargs=+ HiLink hi link <args> | |
50 else | |
51 command -nargs=+ HiLink hi def link <args> | |
52 endif | |
53 | |
54 HiLink manTitle Title | |
55 HiLink manSectionHeading Statement | |
56 HiLink manOptionDesc Constant | |
57 HiLink manLongOptionDesc Constant | |
58 HiLink manReference PreProc | |
59 HiLink manSubHeading Function | |
60 HiLink manCFuncDefinition Function | |
61 | |
62 delcommand HiLink | |
63 endif | |
64 | |
65 let b:current_syntax = "man" | |
66 | |
67 " vim:ts=8 sts=2 sw=2: |