mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-21 20:52:26 +01:00
Add --builtin=pager to readme, completions, and man pages
This commit is contained in:
@@ -635,9 +635,11 @@ syntax, use (this mapping is already built in):
|
|||||||
### Using a different pager
|
### Using a different pager
|
||||||
|
|
||||||
`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
|
`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
|
set, `less` is used by default. You can also use bat's built-in pager with `--pager=builtin` or
|
||||||
`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
|
by setting the `BAT_PAGER` environment variable to "builtin".
|
||||||
`PAGER`.
|
|
||||||
|
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]
|
>[!NOTE]
|
||||||
> If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.
|
> If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.
|
||||||
|
1
assets/completions/bat.fish.in
vendored
1
assets/completions/bat.fish.in
vendored
@@ -106,6 +106,7 @@ set -l pager_opts '
|
|||||||
less\ -FR\t
|
less\ -FR\t
|
||||||
more\t
|
more\t
|
||||||
vimpager\t
|
vimpager\t
|
||||||
|
builtin\t
|
||||||
'
|
'
|
||||||
|
|
||||||
set -l italic_text_opts '
|
set -l italic_text_opts '
|
||||||
|
5
assets/manual/bat.1.in
vendored
5
assets/manual/bat.1.in
vendored
@@ -149,8 +149,9 @@ which pager is used, see the '\-\-pager' option. Possible values: *auto*, never,
|
|||||||
\fB\-\-pager\fR <command>
|
\fB\-\-pager\fR <command>
|
||||||
.IP
|
.IP
|
||||||
Determine which pager is used. This option will override the PAGER and BAT_PAGER
|
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
|
environment variables. The default pager is 'less'. If you provide '\-\-pager=builtin', use
|
||||||
the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
|
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.
|
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
|
.HP
|
||||||
|
@@ -95,14 +95,15 @@ Options:
|
|||||||
piped to another program, but you want to keep the colorization/decorations.
|
piped to another program, but you want to keep the colorization/decorations.
|
||||||
|
|
||||||
--paging <when>
|
--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
|
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 is used, see the '--pager' option. Possible values: *auto*, never, always.
|
||||||
|
|
||||||
--pager <command>
|
--pager <command>
|
||||||
Determine which pager is used. This option will override the PAGER and BAT_PAGER
|
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
|
environment variables. The default pager is 'less'. If you provide '--pager=builtin', use
|
||||||
the '--paging' option. Example: '--pager "less -RF"'.
|
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>
|
-m, --map-syntax <glob:syntax>
|
||||||
Map a glob pattern to an existing syntax name. The glob pattern is matched on the full
|
Map a glob pattern to an existing syntax name. The glob pattern is matched on the full
|
||||||
|
@@ -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).")
|
.help("Specify when to use the pager, or use `-P` to disable (*auto*, never, always).")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Specify when to use the pager. To disable the pager, use \
|
"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 \
|
set BAT_PAGING to 'never'. To control which pager is used, see the \
|
||||||
'--pager' option. Possible values: *auto*, never, always."
|
'--pager' option. Possible values: *auto*, never, always."
|
||||||
),
|
),
|
||||||
@@ -354,6 +354,7 @@ pub fn build_app(interactive_output: bool) -> Command {
|
|||||||
.long_help(
|
.long_help(
|
||||||
"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 'less'. \
|
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. \
|
To control when the pager is used, see the '--paging' option. \
|
||||||
Example: '--pager \"less -RF\"'."
|
Example: '--pager \"less -RF\"'."
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user