1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-21 12:42:26 +01:00

Add --builtin=pager to readme, completions, and man pages

This commit is contained in:
Academician
2025-09-09 12:25:41 -04:00
parent a470cebf32
commit c29f1875d3
5 changed files with 15 additions and 9 deletions

View File

@@ -635,9 +635,11 @@ syntax, use (this mapping is already built in):
### Using a different pager
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
set, `less` is used by default. If you want to use a different pager, you can either modify the
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
`PAGER`.
set, `less` is used by default. You can also use bat's built-in pager with `--pager=builtin` or
by setting the `BAT_PAGER` environment variable to "builtin".
If you want to use a different pager, you can either modify the `PAGER` variable or set the
`BAT_PAGER` environment variable to override what is specified in `PAGER`.
>[!NOTE]
> If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.

View File

@@ -106,6 +106,7 @@ set -l pager_opts '
less\ -FR\t
more\t
vimpager\t
builtin\t
'
set -l italic_text_opts '

View File

@@ -149,8 +149,9 @@ which pager is used, see the '\-\-pager' option. Possible values: *auto*, never,
\fB\-\-pager\fR <command>
.IP
Determine which pager is used. This option will override the PAGER and BAT_PAGER
environment variables. The default pager is 'less'. To control when the pager is used, see
the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
environment variables. The default pager is 'less'. If you provide '\-\-pager=builtin', use
the built-in 'minus' pager. To control when the pager is used, see the '\-\-paging' option.
Example: '\-\-pager "less \fB\-RF\fR"'.
Note: By default, if the pager is set to 'less' (and no command-line options are specified), 'bat' will pass the following command line options to the pager: '-R'/'--RAW-CONTROL-CHARS', '-F'/'--quit-if-one-screen' and '-X'/'--no-init'. The last option ('-X') is only used for 'less' versions older than 530. The '-R' option is needed to interpret ANSI colors correctly. The second option ('-F') instructs less to exit immediately if the output size is smaller than the vertical size of the terminal. This is convenient for small files because you do not have to press 'q' to quit the pager. The third option ('-X') is needed to fix a bug with the '--quit-if-one-screen' feature in old versions of 'less'. Unfortunately, it also breaks mouse-wheel support in 'less'. If you want to enable mouse-wheel scrolling on older versions of 'less', you can pass just '-R' (as in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer, it should work out of the box.
.HP

View File

@@ -95,14 +95,15 @@ Options:
piped to another program, but you want to keep the colorization/decorations.
--paging <when>
Specify when to use the pager. To disable the pager, use --paging=never' or its
Specify when to use the pager. To disable the pager, use '--paging=never' or its
alias,'-P'. To disable the pager permanently, set BAT_PAGING to 'never'. To control which
pager is used, see the '--pager' option. Possible values: *auto*, never, always.
--pager <command>
Determine which pager is used. This option will override the PAGER and BAT_PAGER
environment variables. The default pager is 'less'. To control when the pager is used, see
the '--paging' option. Example: '--pager "less -RF"'.
environment variables. The default pager is 'less'. If you provide '--pager=builtin', use
the built-in 'minus' pager. To control when the pager is used, see the '--paging' option.
Example: '--pager "less -RF"'.
-m, --map-syntax <glob:syntax>
Map a glob pattern to an existing syntax name. The glob pattern is matched on the full

View File

@@ -328,7 +328,7 @@ pub fn build_app(interactive_output: bool) -> Command {
.help("Specify when to use the pager, or use `-P` to disable (*auto*, never, always).")
.long_help(
"Specify when to use the pager. To disable the pager, use \
--paging=never' or its alias,'-P'. To disable the pager permanently, \
'--paging=never' or its alias,'-P'. To disable the pager permanently, \
set BAT_PAGING to 'never'. To control which pager is used, see the \
'--pager' option. Possible values: *auto*, never, always."
),
@@ -354,6 +354,7 @@ pub fn build_app(interactive_output: bool) -> Command {
.long_help(
"Determine which pager is used. This option will override the \
PAGER and BAT_PAGER environment variables. The default pager is 'less'. \
If you provide '--pager=builtin', use the built-in 'minus' pager. \
To control when the pager is used, see the '--paging' option. \
Example: '--pager \"less -RF\"'."
),