From b35a74b73a381e120d9c1bcc6b2ed882fad7a2ba Mon Sep 17 00:00:00 2001 From: nazdridoy <45564804+nazdridoy@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:08:46 +0600 Subject: [PATCH 1/5] Turn off line numbers to preserve the default behavior of cat --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57baf2b079..07968733c9 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 From 4170d9b0f22648d215bee60802eeeb1f20a2f404 Mon Sep 17 00:00:00 2001 From: nazdridoy <45564804+nazdridoy@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:17:23 +0600 Subject: [PATCH 2/5] Added batlog alias for reading logfiles --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 07968733c9..c6879b3df6 100644 --- a/README.md +++ b/README.md @@ -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. From a2d62bd8f40210e2b78b3a8f0eb2935c7d622bc9 Mon Sep 17 00:00:00 2001 From: nazdridoy <45564804+nazdridoy@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:29:36 +0600 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6879b3df6..9f7525fb8b 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ 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 +You can also add an alias `batlog` to read any logfile ```bash alias batlog='bat --paging=never -l log' From fc2c66685a5a393176e1ae55a5f7c7f70df3a9fc Mon Sep 17 00:00:00 2001 From: nazdridoy <45564804+nazdridoy@users.noreply.github.com> Date: Sun, 25 Feb 2024 18:06:39 +0600 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 613fb8b94f..5133fe83aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 63ee7a653d31dcb10be56c1f75edb2f4e7ebfb6d Mon Sep 17 00:00:00 2001 From: nazdridoy <45564804+nazdridoy@users.noreply.github.com> Date: Sun, 25 Feb 2024 18:11:48 +0600 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5133fe83aa..b31e6bd140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +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) +- Updated alias for cat (to preserve the default behavior) and added batlog #2870 (@nazdridoy) ## Syntaxes