mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-20 11:58:45 +00:00
Scope environment variable and commands sections in Manpages
This commit is contained in:
parent
1004018941
commit
52ef1bc0d6
@ -19,7 +19,7 @@
|
||||
|
||||
- Added support for Ada, see #1300 and #2316 (@dkm)
|
||||
- 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 VimHelp syntax, see #2366 (@Freed-Wu)
|
||||
- Associate `pdm.lock` with `TOML` syntax, see #2410
|
||||
|
30
assets/syntaxes/02_Extra/Manpage.sublime-syntax
vendored
30
assets/syntaxes/02_Extra/Manpage.sublime-syntax
vendored
@ -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
|
||||
|
53
assets/syntaxes/02_Extra/syntax_test_man.man
vendored
53
assets/syntaxes/02_Extra/syntax_test_man.man
vendored
@ -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
|
||||
|
@ -40,7 +40,7 @@
|
||||
[38;2;248;248;242m ables automatic paging (alias for '[0m[38;2;166;226;46m--style[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mplain[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--pager[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mnever'[0m[38;2;248;248;242m).[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-l[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--language[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mlanguage[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-l[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46m--language[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mlanguage[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Explicitly set the language for syntax highlighting. The lan‐[0m
|
||||
[38;2;248;248;242m guage can be specified as a name (like 'C++' or 'LaTeX') or pos‐[0m
|
||||
@ -65,18 +65,18 @@
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--highlight-line[0m[38;2;248;248;242m 40:[0m
|
||||
[38;2;248;248;242m highlights lines 40 to the end of the file[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--tabs[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mT[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--tabs[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mT[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Set the tab width to T spaces. Use a width of 0 to pass tabs[0m
|
||||
[38;2;248;248;242m through directly[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--wrap[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mmode[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--wrap[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mmode[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Specify the text-wrapping mode (*auto*, never, character). The[0m
|
||||
[38;2;248;248;242m '[0m[38;2;166;226;46m--terminal-width[0m[38;2;248;248;242m' option can be used in addition to control the[0m
|
||||
[38;2;248;248;242m output width.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--terminal-width[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mwidth[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--terminal-width[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mwidth[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Explicitly set the width of the terminal instead of determining[0m
|
||||
[38;2;248;248;242m it automatically. If prefixed with '+' or '-', the value will be[0m
|
||||
@ -88,18 +88,18 @@
|
||||
[38;2;248;248;242m Only show line numbers, no other decorations. This is an alias[0m
|
||||
[38;2;248;248;242m for '[0m[38;2;166;226;46m--style[0m[38;2;249;38;114m=[0m[3;38;2;253;151;31mnumbers'[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Specify when to use colored output. The automatic mode only en‐[0m
|
||||
[38;2;248;248;242m ables colors if an interactive terminal is detected. Possible[0m
|
||||
[38;2;248;248;242m values: *auto*, never, always.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--italic-text[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--italic-text[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Specify when to use ANSI sequences for italic text in the out‐[0m
|
||||
[38;2;248;248;242m put. Possible values: always, *never*.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--decorations[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--decorations[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Specify when to use the decorations that have been specified via[0m
|
||||
[38;2;248;248;242m '[0m[38;2;166;226;46m--style[0m[38;2;248;248;242m'. The automatic mode only enables decorations if an in‐[0m
|
||||
@ -112,7 +112,7 @@
|
||||
[38;2;248;248;242m if the output of bat is piped to another program, but you want[0m
|
||||
[38;2;248;248;242m to keep the colorization/decorations.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--paging[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--paging[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mwhen[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Specify when to use the pager. To disable the pager, use '[0m[38;2;166;226;46m--pag[0m[38;2;248;248;242m‐[0m
|
||||
[38;2;248;248;242m ing=never' or its alias, [0m[38;2;166;226;46m-P[0m[38;2;248;248;242m. To disable the pager permanently,[0m
|
||||
@ -120,7 +120,7 @@
|
||||
[38;2;248;248;242m used, see the '[0m[38;2;166;226;46m--pager[0m[38;2;248;248;242m' option. Possible values: *auto*, never,[0m
|
||||
[38;2;248;248;242m always.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--pager[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mcommand[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--pager[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mcommand[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Determine which pager is used. This option will override the[0m
|
||||
[38;2;248;248;242m PAGER and BAT_PAGER environment variables. The default pager is[0m
|
||||
@ -135,7 +135,7 @@
|
||||
[38;2;248;248;242m '*.build:Python'. To highlight files named '.myignore' with the[0m
|
||||
[38;2;248;248;242m Git Ignore syntax, use [0m[38;2;166;226;46m-m[0m[38;2;248;248;242m '.myignore:Git Ignore'.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--theme[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mtheme[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--theme[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mtheme[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Set the theme for syntax highlighting. Use '[0m[38;2;166;226;46m--list-themes[0m[38;2;248;248;242m' to[0m
|
||||
[38;2;248;248;242m see all available themes. To set a default theme, add the[0m
|
||||
@ -146,7 +146,7 @@
|
||||
|
||||
[38;2;248;248;242m Display a list of supported themes for syntax highlighting.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--style[0m[38;2;248;248;242m <[0m[3;38;2;253;151;31mstyle-components[0m[38;2;248;248;242m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--style[0m[38;2;248;248;242m [0m[38;2;248;248;242m<[0m[3;38;2;253;151;31mstyle-components[0m[38;2;248;248;242m>[0m
|
||||
|
||||
[38;2;248;248;242m Configure which elements (line numbers, file headers, grid bor‐[0m
|
||||
[38;2;248;248;242m ders, Git modifications, ..) to display in addition to the file[0m
|
||||
|
@ -468,12 +468,12 @@
|
||||
[38;2;248;248;242m Note that most options have the opposite versions with [0m[38;2;166;226;46m--no-[0m[38;2;248;248;242m prefix.[0m
|
||||
|
||||
[38;2;253;151;31mENVIRONMENT VARIABLES[0m
|
||||
[38;2;248;248;242m FZF_DEFAULT_COMMAND[0m
|
||||
[38;2;248;248;242m Default command to use when input is tty. On *nix systems, fzf runs the command with [0m[38;2;255;255;255m$[0m[38;2;190;132;255mSHELL[0m[38;2;248;248;242m [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m if SHELL is set, otherwise with sh [0m[38;2;166;226;46m-c[0m[38;2;248;248;242m, so in this case make sure that the command[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mFZF_DEFAULT_COMMAND[0m
|
||||
[38;2;248;248;242m 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[0m
|
||||
[38;2;248;248;242m is POSIX-compliant.[0m
|
||||
|
||||
[38;2;248;248;242m FZF_DEFAULT_OPTS[0m
|
||||
[38;2;248;248;242m Default options. e.g. export FZF_DEFAULT_OPTS="[0m[38;2;166;226;46m--extended[0m[38;2;248;248;242m [0m[38;2;166;226;46m--cycle[0m[38;2;248;248;242m"[0m
|
||||
[38;2;248;248;242m [0m[38;2;102;217;239mFZF_DEFAULT_OPTS[0m
|
||||
[38;2;248;248;242m Default options. e.g. export FZF_DEFAULT_OPTS="--extended --cycle"[0m
|
||||
|
||||
[38;2;253;151;31mEXIT STATUS[0m
|
||||
[38;2;248;248;242m 0 Normal exit[0m
|
||||
|
1033
tests/syntax-tests/highlighted/Manpage/sway.5.man
vendored
Normal file
1033
tests/syntax-tests/highlighted/Manpage/sway.5.man
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1033
tests/syntax-tests/source/Manpage/sway.5.man
vendored
Normal file
1033
tests/syntax-tests/source/Manpage/sway.5.man
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user