Mercurial > vim
annotate runtime/syntax/man.vim @ 20416:5ab2bc28e113
Added tag v8.2.0762 for changeset b582eb6ef1928b50f2bb38e0dc4ba691fc52902a
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 May 2020 22:45:04 +0200 |
parents | 56265f711890 |
children | a3bb84cd0f59 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Man page | |
20241 | 3 " Maintainer: Jason Franklin <vim@justemail.net> |
4 " Previous Maintainer: SungHyun Nam <goweol@gmail.com> | |
7 | 5 " Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com> |
6 " Version Info: | |
20241 | 7 " Last Change: 2020 Apr 30 |
7 | 8 |
9 " Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>: | |
10 " * manSubHeading | |
11 " * manSynopsis (only for sections 2 and 3) | |
12 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7272
diff
changeset
|
13 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7272
diff
changeset
|
14 if exists("b:current_syntax") |
7 | 15 finish |
16 endif | |
17 | |
18 " Get the CTRL-H syntax to handle backspaced text | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7272
diff
changeset
|
19 runtime! syntax/ctrlh.vim |
7 | 20 |
21 syn case ignore | |
20115 | 22 |
7 | 23 syn match manReference "\f\+([1-9][a-z]\=)" |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
2034
diff
changeset
|
24 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
|
25 syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" |
7 | 26 syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" |
27 syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" | |
28 " syn match manHistory "^[a-z].*last change.*$" | |
29 | |
20241 | 30 syn match manHeader '\%1l.*' |
31 exe 'syn match manFooter ''\%' . line('$') . 'l.*''' | |
32 | |
7 | 33 if getline(1) =~ '^[a-zA-Z_]\+([23])' |
34 syntax include @cCode <sfile>:p:h/c.vim | |
35 syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained | |
1621 | 36 syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition |
7 | 37 endif |
38 | |
39 | |
40 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7272
diff
changeset
|
41 " Only when an item doesn't have highlighting yet |
7 | 42 |
20115 | 43 hi def link manHeader Title |
44 hi def link manFooter PreProc | |
45 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
46 hi def link manSectionHeading Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
47 hi def link manOptionDesc Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
48 hi def link manLongOptionDesc Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
49 hi def link manReference PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
50 hi def link manSubHeading Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
51 hi def link manCFuncDefinition Function |
7 | 52 |
53 | |
54 let b:current_syntax = "man" | |
55 | |
56 " vim:ts=8 sts=2 sw=2: |