on master help sign in
Add "xclip" section
commit6e9ca7d6dc2e5a12242ed8bef999666783982fb2 authorDavid Peter <sharkdp@users.noreply.github.com> dateMon 11 Feb 2019, 22:01 (8 years ago) parenta9ec5c0
1 file changed+10
README.md+10
README.md+10
@@ -114,6 +114,16 @@ tail -f /var/log/pacman.log | bat --paging=never -l log
114114Note that we have to switch off paging in order for this to work. We have also specified the syntax
115115explicitly (`-l log`), as it can not be auto-detected in this case.
116116
117+#### `xclip`
118+
119+The line numbers and Git modification markers in the output of `bat` can make it hard to copy
120+the contents of a file. To prevent this, you can call `bat` with the `-p`/`--plain` option or
121+simply pipe the output into `xclip`:
122+```
123+bat main.cpp | xclip
124+```
125+`bat` will detect that the output is being redirected and print the plain file contents.
126+
117127## Installation
118128
119129### On Ubuntu