mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-01-05 20:58:51 +01:00
Added script for using bat with man
This commit is contained in:
parent
369d7f4eef
commit
85bb5f8bed
@ -7,6 +7,7 @@ Bash scripts that integrate [bat](https://github.com/sharkdp/bat) with various c
|
||||
## Scripts
|
||||
|
||||
- [`batgrep`](doc/batgrep.md) (ripgrep + bat)
|
||||
- [`batman`](doc/batman.md) (man with bat)
|
||||
- [`prettybat`](doc/prettybat.md) (pretty printing + bat)
|
||||
|
||||
|
||||
|
30
doc/batman.md
Normal file
30
doc/batman.md
Normal file
@ -0,0 +1,30 @@
|
||||
# bat-extras: batman
|
||||
|
||||
A script that allows bat to be used as a manual highlighter.
|
||||
|
||||
|
||||
|
||||
## Command Line
|
||||
|
||||
**Synopsis:**
|
||||
|
||||
- `batman [SECTION] [ENTRY] `
|
||||
|
||||
|
||||
|
||||
## Caveats
|
||||
|
||||
None so far.
|
||||
|
||||
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Thanks to [@sharkdp](https://github.com/sharkdp) and [@LunarLambda](https://github.com/LunarLambda) for debugging how to make this work properly in [certain environments](https://github.com/sharkdp/bat/issues/652).
|
||||
|
||||
|
||||
|
||||
## Issues?
|
||||
|
||||
If you find an issue or have a feature suggestion, make a pull request or issue through GitHub!
|
||||
Contributions are always welcome.
|
20
src/batman.sh
Executable file
20
src/batman.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# -----------------------------------------------------------------------------
|
||||
# bat-extras | Copyright (C) 2019 eth-p | MIT License
|
||||
#
|
||||
# Repository: https://github.com/eth-p/bat-extras
|
||||
# Issues: https://github.com/eth-p/bat-extras/issues
|
||||
# -----------------------------------------------------------------------------
|
||||
LIB="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../lib"
|
||||
source "${LIB}/print.sh"
|
||||
source "${LIB}/opt.sh"
|
||||
source "${LIB}/version.sh"
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
export MANPAGER='sh -c "col -bx | bat --language man --style grid"'
|
||||
export MANROFFOPT='-c'
|
||||
export BAT_PAGER="$PAGER"
|
||||
|
||||
command man "$@"
|
||||
exit $?
|
||||
|
Loading…
Reference in New Issue
Block a user