forked from sharkdp/bat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manpage.sublime-syntax
53 lines (45 loc) · 1.24 KB
/
Manpage.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Manpage
file_extensions:
- man
scope: source.man
variables:
section_heading: '^\S.*$'
contexts:
main:
- match: ^
push: first_line
first_line:
- match: '([A-Z0-9_\-]+)(\()([^)]+)(\))'
captures:
1: meta.preprocessor
2: keyword.operator
3: string.quoted.other
4: keyword.operator
- match: '$'
push: body
body:
- match: '^(SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
push: Packages/C/C.sublime-syntax
scope: markup.heading
with_prototype:
- match: '(?={{section_heading}})'
pop: true
- match: '^\S.*$'
scope: markup.heading
- match: '\b([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
captures:
1: entity.name.function
2: keyword.operator
3: constant.numeric
4: keyword.operator
# command-line options like --option=value, --some-flag, or -x
- match: '(?:[^a-zA-Z0-9_-]|^|\s)(--?[A-Za-z0-9][A-Za-z0-9-]*)(?:(=)?("?)([A-Za-z0-9]+)("?))?'
captures:
1: entity.name
2: keyword.operator
3: punctuation.definition.string.begin
4: variable.parameter
3: punctuation.definition.string.end