Scope environment variable and commands sections in Manpages

This commit is contained in:
Keith Hall 2023-01-28 23:23:39 +02:00 committed by Martin Nordholts
parent 1004018941
commit 52ef1bc0d6
7 changed files with 2165 additions and 16 deletions

View File

@ -19,7 +19,7 @@
- Added support for Ada, see #1300 and #2316 (@dkm) - Added support for Ada, see #1300 and #2316 (@dkm)
- Added `todo.txt` syntax, see #2375 (@BANOnotIT) - Added `todo.txt` syntax, see #2375 (@BANOnotIT)
- Improve Manpage.sublime-syntax. See #2364 (@Freed-Wu) - Improve Manpage.sublime-syntax. See #2364 (@Freed-Wu) and #2461 (@keith-hall)
- Added a new `requirements.txt` syntax, see #2361 (@Freed-Wu) - Added a new `requirements.txt` syntax, see #2361 (@Freed-Wu)
- Added a new VimHelp syntax, see #2366 (@Freed-Wu) - Added a new VimHelp syntax, see #2366 (@Freed-Wu)
- Associate `pdm.lock` with `TOML` syntax, see #2410 - Associate `pdm.lock` with `TOML` syntax, see #2410

View File

@ -53,6 +53,16 @@ contexts:
embed: synopsis embed: synopsis
escape: '(?={{section_heading}})' 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}}' - match: '{{section_heading}}'
scope: markup.heading.other.man scope: markup.heading.other.man
embed: options # some man pages put command line options under the description heading embed: options # some man pages put command line options under the description heading
@ -135,6 +145,10 @@ contexts:
scope: punctuation.section.brackets.end.man scope: punctuation.section.brackets.end.man
pop: true pop: true
- include: expect-parameter - include: expect-parameter
- match: '<'
scope: punctuation.definition.generic.begin.man
- match: '>'
scope: punctuation.definition.generic.end.man
- match: '$|(?=[],]|{{command_line_option}})' - match: '$|(?=[],]|{{command_line_option}})'
pop: true pop: true
@ -169,3 +183,19 @@ contexts:
- match: \[ - match: \[
scope: punctuation.section.brackets.begin.man scope: punctuation.section.brackets.begin.man
push: command-line-option-or-pipe 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

View File

@ -157,6 +157,59 @@ ENVIRONMENT
systemd reads the log level from this environment variable. This systemd reads the log level from this environment variable. This
can be overridden with --log-level=. 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 wont 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 SEE ALSO
The systemd Homepage[11], systemd-system.conf(5), locale.conf(5) The systemd Homepage[11], systemd-system.conf(5), locale.conf(5)
# ^^^^^^^^^^^^^^^^^^^ entity.name.function # ^^^^^^^^^^^^^^^^^^^ entity.name.function

View File

@ -40,7 +40,7 @@
 ables automatic paging (alias for '--style=plain  ables automatic paging (alias for '--style=plain
 --pager=never').  --pager=never').
 -l, --language <language>  -l, --language <language>
 Explicitly set the language for syntax highlighting. The lan  Explicitly set the language for syntax highlighting. The lan
 guage can be specified as a name (like 'C++' or 'LaTeX') or pos  guage can be specified as a name (like 'C++' or 'LaTeX') or pos
@ -65,18 +65,18 @@
 --highlight-line 40:  --highlight-line 40:
 highlights lines 40 to the end of the file  highlights lines 40 to the end of the file
 --tabs <T>  --tabs <T>
 Set the tab width to T spaces. Use a width of 0 to pass tabs  Set the tab width to T spaces. Use a width of 0 to pass tabs
 through directly  through directly
 --wrap <mode>  --wrap <mode>
 Specify the text-wrapping mode (*auto*, never, character). The  Specify the text-wrapping mode (*auto*, never, character). The
 '--terminal-width' option can be used in addition to control the  '--terminal-width' option can be used in addition to control the
 output width.  output width.
 --terminal-width <width>  --terminal-width <width>
 Explicitly set the width of the terminal instead of determining  Explicitly set the width of the terminal instead of determining
 it automatically. If prefixed with '+' or '-', the value will be  it automatically. If prefixed with '+' or '-', the value will be
@ -88,18 +88,18 @@
 Only show line numbers, no other decorations. This is an alias  Only show line numbers, no other decorations. This is an alias
 for '--style=numbers'  for '--style=numbers'
 --color <when>  --color <when>
 Specify when to use colored output. The automatic mode only en  Specify when to use colored output. The automatic mode only en
 ables colors if an interactive terminal is detected. Possible  ables colors if an interactive terminal is detected. Possible
 values: *auto*, never, always.  values: *auto*, never, always.
 --italic-text <when>  --italic-text <when>
 Specify when to use ANSI sequences for italic text in the out  Specify when to use ANSI sequences for italic text in the out
 put. Possible values: always, *never*.  put. Possible values: always, *never*.
 --decorations <when>  --decorations <when>
 Specify when to use the decorations that have been specified via  Specify when to use the decorations that have been specified via
 '--style'. The automatic mode only enables decorations if an in  '--style'. The automatic mode only enables decorations if an in
@ -112,7 +112,7 @@
 if the output of bat is piped to another program, but you want  if the output of bat is piped to another program, but you want
 to keep the colorization/decorations.  to keep the colorization/decorations.
 --paging <when>  --paging <when>
 Specify when to use the pager. To disable the pager, use '--pag  Specify when to use the pager. To disable the pager, use '--pag
 ing=never' or its alias, -P. To disable the pager permanently,  ing=never' or its alias, -P. To disable the pager permanently,
@ -120,7 +120,7 @@
 used, see the '--pager' option. Possible values: *auto*, never,  used, see the '--pager' option. Possible values: *auto*, never,
 always.  always.
 --pager <command>  --pager <command>
 Determine which pager is used. This option will override the  Determine which pager is used. This option will override the
 PAGER and BAT_PAGER environment variables. The default pager is  PAGER and BAT_PAGER environment variables. The default pager is
@ -135,7 +135,7 @@
 '*.build:Python'. To highlight files named '.myignore' with the  '*.build:Python'. To highlight files named '.myignore' with the
 Git Ignore syntax, use -m '.myignore:Git Ignore'.  Git Ignore syntax, use -m '.myignore:Git Ignore'.
 --theme <theme>  --theme <theme>
 Set the theme for syntax highlighting. Use '--list-themes' to  Set the theme for syntax highlighting. Use '--list-themes' to
 see all available themes. To set a default theme, add the  see all available themes. To set a default theme, add the
@ -146,7 +146,7 @@
 Display a list of supported themes for syntax highlighting.  Display a list of supported themes for syntax highlighting.
 --style <style-components>  --style <style-components>
 Configure which elements (line numbers, file headers, grid bor  Configure which elements (line numbers, file headers, grid bor
 ders, Git modifications, ..) to display in addition to the file  ders, Git modifications, ..) to display in addition to the file

View File

@ -468,12 +468,12 @@
 Note that most options have the opposite versions with --no- prefix.  Note that most options have the opposite versions with --no- prefix.
ENVIRONMENT VARIABLES ENVIRONMENT VARIABLES
 FZF_DEFAULT_COMMAND  FZF_DEFAULT_COMMAND
 Default command to use when input is tty. On *nix systems, fzf runs the command with $SHELL -c if SHELL is set, otherwise with sh -c, so in this case make sure that the command  Default command to use when input is tty. On *nix systems, fzf runs the command with $SHELL -c if SHELL is set, otherwise with sh -c, so in this case make sure that the command
 is POSIX-compliant.  is POSIX-compliant.
 FZF_DEFAULT_OPTS  FZF_DEFAULT_OPTS
 Default options. e.g. export FZF_DEFAULT_OPTS="--extended --cycle"  Default options. e.g. export FZF_DEFAULT_OPTS="--extended --cycle"
EXIT STATUS EXIT STATUS
 0 Normal exit  0 Normal exit

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff