diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ec2da9b5..bf1775a9a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Improve performance when color output disabled, see #2397 and #2857 (@eth-p) - Relax syntax mapping rule restrictions to allow brace expansion #2865 (@cyqsimon) - Apply clippy fixes #2864 (@cyqsimon) +- Updated alias for cat (to preserve the default behavior) and added batlog #2870 (@nazdridoy) - Faster startup by offloading glob matcher building to a worker thread #2868 (@cyqsimon) - Display which theme is the default one in basic output (no colors), see #2937 (@sblondon) - Display which theme is the default one in colored output, see #2838 (@sblondon) diff --git a/README.md b/README.md index 016fe83427..dbc457470c 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ characters: By default, `bat` pipes its own output to a pager (e.g. `less`) if the output is too large for one screen. If you would rather `bat` work like `cat` all the time (never page output), you can set `--paging=never` as an option, either on the command line or in your configuration file. -If you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --paging=never'` to preserve the default behavior. +If you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --style=plain --paging=never'` to preserve the default behavior. #### File concatenation @@ -162,6 +162,16 @@ batgrep needle src/ ```bash tail -f /var/log/pacman.log | bat --paging=never -l log ``` +You can also add an alias `batlog` to read any logfile + +```bash +alias batlog='bat --paging=never -l log' + +tail -f /var/log/pacman.log | batlog + +batlog /var/log/pacman.log +``` + Note that we have to switch off paging in order for this to work. We have also specified the syntax explicitly (`-l log`), as it can not be auto-detected in this case.