summaryrefslogtreecommitdiffstats
path: root/assets/syntaxes/02_Extra
diff options
context:
space:
mode:
authorKeith Hall <kingkeith+github@gmail.com>2023-01-28 23:23:39 +0200
committerMartin Nordholts <enselic@gmail.com>2023-02-05 16:56:54 +0100
commit52ef1bc0d6bead9f450efe28a457acbcb1e94d88 (patch)
tree5075dc27f29b6a9f8a73e5e30b76bbc237290067 /assets/syntaxes/02_Extra
parent1004018941eb0f3c85c2a535c2d6631ef9ef6385 (diff)
Scope environment variable and commands sections in Manpages
Diffstat (limited to 'assets/syntaxes/02_Extra')
-rw-r--r--assets/syntaxes/02_Extra/Manpage.sublime-syntax30
-rw-r--r--assets/syntaxes/02_Extra/syntax_test_man.man53
2 files changed, 83 insertions, 0 deletions
diff --git a/assets/syntaxes/02_Extra/Manpage.sublime-syntax b/assets/syntaxes/02_Extra/Manpage.sublime-syntax
index 00a9bc73..02e933aa 100644
--- a/assets/syntaxes/02_Extra/Manpage.sublime-syntax
+++ b/assets/syntaxes/02_Extra/Manpage.sublime-syntax
@@ -53,6 +53,16 @@ contexts:
embed: synopsis
escape: '(?={{section_heading}})'
+ - match: '^(?:COMMANDS)\b'
+ scope: markup.heading.commands.man
+ embed: commands-start
+ escape: '(?={{section_heading}})'
+
+ - match: '^(?:ENVIRONMENT\s+VARIABLES)'
+ scope: markup.heading.env.man
+ embed: environment-variables
+ escape: '(?={{section_heading}})'
+
- match: '{{section_heading}}'
scope: markup.heading.other.man
embed: options # some man pages put command line options under the description heading
@@ -135,6 +145,10 @@ contexts:
scope: punctuation.section.brackets.end.man
pop: true
- include: expect-parameter
+ - match: '<'
+ scope: punctuation.definition.generic.begin.man
+ - match: '>'
+ scope: punctuation.definition.generic.end.man
- match: '$|(?=[],]|{{command_line_option}})'
pop: true
@@ -169,3 +183,19 @@ contexts:
- match: \[
scope: punctuation.section.brackets.begin.man
push: command-line-option-or-pipe
+
+ commands-start:
+ - match: '^[ ]{7}(?=.*(?:[ ]<|[|]))'
+ push: commands
+
+ commands:
+ - match: '[-\w]+'
+ scope: entity.name.command.man
+ push: expect-parameter
+ - match: $
+ pop: true
+
+ environment-variables:
+ - match: '^[ ]{7}([A-Z_]+)\b'
+ captures:
+ 1: support.constant.environment-variable.man
diff --git a/assets/syntaxes/02_Extra/syntax_test_man.man b/assets/syntaxes/02_Extra/syntax_test_man.man
index 792c02a0..3535d350 100644
--- a/assets/syntaxes/02_Extra/syntax_test_man.man
+++ b/assets/syntaxes/02_Extra/syntax_test_man.man
@@ -157,6 +157,59 @@ ENVIRONMENT
systemd reads the log level from this environment variable. This
can be overridden with --log-level=.
+ENVIRONMENT VARIABLES
+ Various Git commands use the following environment variables:
+
+ The Git Repository
+ These environment variables apply to all core Git commands. Nb: it is
+ worth noting that they may be used/overridden by SCMS sitting above Git
+ so take care if using a foreign front-end.
+
+ GIT_INDEX_FILE
+# ^^^^^^^^^^^^^^ support.constant.environment-variable
+ This environment allows the specification of an alternate index
+ file. If not specified, the default of $GIT_DIR/index is used.
+
+ GIT_INDEX_VERSION
+# ^^^^^^^^^^^^^^^^^ support.constant.environment-variable
+ This environment variable allows the specification of an index
+ version for new repositories. It won’t affect existing index files.
+ By default index file version 2 or 3 is used. See git-update-
+ index(1) for more information.
+
+COMMANDS
+ This section only lists general commands. For input and output com‐
+ mands, refer to sway-input(5) and sway-output(5).
+
+ The following commands may only be used in the configuration file.
+
+ bar [<bar-id>] <bar-subcommands...>
+# ^^^ entity.name.command
+# ^ punctuation.section.brackets.begin
+# ^ punctuation.definition.generic.begin
+# ^^^^^^ variable.parameter
+# ^ punctuation.definition.generic.end
+# ^ punctuation.section.brackets.end
+# ^ punctuation.definition.generic.begin
+# ^^^^^^^^^^^^^^^ variable.parameter
+# ^ punctuation.definition.generic.end
+ For details on bar subcommands, see sway-bar(5).
+
+ default_orientation horizontal|vertical|auto
+# ^^^^^^^^^^^^^^^^^^^ entity.name.command
+# ^^^^^^^^^^ variable.parameter
+# ^ keyword.operator.logical
+# ^^^^^^^^ variable.parameter
+# ^ keyword.operator.logical
+# ^^^^ variable.parameter
+ Sets the default container layout for tiled containers.
+
+ include <path>
+ Includes another file from path. path can be either a full path or
+ a path relative to the parent config, and expands shell syntax (see
+ wordexp(3) for details). The same include file can only be included
+ once; subsequent attempts will be ignored.
+
SEE ALSO
The systemd Homepage[11], systemd-system.conf(5), locale.conf(5)
# ^^^^^^^^^^^^^^^^^^^ entity.name.function