on master help sign in
PAGER: Wrapper script is not needed anymore
commit5219c40ed89e1d564d990e20fd468958195828ef authorDavid Peter <sharkdp@users.noreply.github.com> dateSat 20 Oct 2018, 14:54 (8 years ago) parenta25ee0e
1 file changed+3−7
README.md+3−7
README.md+3−7
@@ -292,16 +292,12 @@ set, `less` is used by default. If you want to use a different pager, you can ei
292292`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
293293`PAGER`.
294294
295−If you want to pass command-line arguments to the pager, you need to create a small shell
296−script as a wrapper, for example
295+If you want to pass command-line arguments to the pager, you can also set them via the
296+`PAGER`/`BAT_PAGER` variables:
297297
298298```bash
299−#!/bin/bash
300−
301−less --tabs 4 -R "$@"
299+export BAT_PAGER="less -RF"
302300```
303−(put this in a file `~/.bat-pager.sh`, make it executable `chmod +x ~/.bat-pager.sh` and use
304−`export BAT_PAGER="$HOME/.bat-pager.sh"` in your shells `rc` file)
305301
306302**Note**: By default, if the pager is set to `less`, `bat` will pass the following command line
307303options to the pager: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` and `-X`/`--no-init`.