From 6e9ca7d6dc2e5a12242ed8bef999666783982fb2 Mon Sep 17 00:00:00 2001 From: David Peter Date: Mon, 11 Feb 2019 22:01:03 +0100 Subject: [PATCH] Add "xclip" section --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index dc22cb8a..7e645d71 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,16 @@ tail -f /var/log/pacman.log | bat --paging=never -l 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. +#### `xclip` + +The line numbers and Git modification markers in the output of `bat` can make it hard to copy +the contents of a file. To prevent this, you can call `bat` with the `-p`/`--plain` option or +simply pipe the output into `xclip`: +``` +bat main.cpp | xclip +``` +`bat` will detect that the output is being redirected and print the plain file contents. + ## Installation ### On Ubuntu