Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix alias for cat (to preserve the default behavior) and added batlog #2870

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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)

## Syntaxes

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down