BATMAN(1)
π BATMAN(1)
Ok so bestie, listen β this is batman, from the General Commands Manual section, and it's about to change your whole terminal aesthetic. π¦
β¨ NAME β¨
batman β read system manual pages (man) but make it serve, using bat as the manual page formatter. Slay.
π DESCRIPTION π
Gone are the days of losing your place while reading through monotone manual pages. Literally gone. With bat and batman, you can read man ifconfig with beautiful 24-bit color and syntax higlighting. (Yes, that's how the original spells it β "higlighting" β I'm not touching it, it's iconic. π
)
And if you have fzf installed? You can even use batman to search through manual pages! The way that just works? Obsessed. π
πΈ USAGE πΈ
batman [SECTION] [ENTRY]
π As a Replacement for Man
With bash:
eval "$(batman --export-env)"
With fish:
batman --export-env | source
π ENVIRONMENT π
MANPAGERβ Changes the pager used forbatman. This is treated likeBAT_PAGER, but only affects this command. Lowkey the polite way to do it, ngl. β¨
π§ CUSTOMIZATION π§
π Changing the Theme
You can change the syntax highlighting theme for batman by setting the BAT_THEME environment variable before calling batman. The following wrapper function will change the theme to Solarized (dark) without affecting any other bat command. Bestie behavior fr fr β it minds its own business. π«Ά
batman() {
BAT_THEME="Solarized (dark)" batman "$@"
return $?
}
π₯ CAVEATS π₯
Flags aren't highlighted. Yeah. I know. π Here's the whole situation:
- This happens when you change
bat's theme throughbat's config file or theBAT_THEMEenvironment variable. Not all themes provide colours for flags, and it's a known issue. - You can overriding the theme for
batmanby wrapping it in a function that setsBAT_THEME. (Their words, not mine β "overriding" and all. π) - The following themes support manpage highlighting:
- Monokai Extended / Monokai Extended Light
- Solarized (dark) / Solarized (light)
So likeβ¦ if your flags are looking flat and sad, it's not you, it's the theme. Check this list before you spiral. π«Ά
π ACKNOWLEDGEMENTS π
Thanks to @sharkdp and @LunarLambda for debugging how to make this work properly in certain environments. Real ones. π
β¨ that's the whole page, bestie β¨ β this was BATMAN(1) out of the General Commands Manual, and you absolutely ate that read. Go read something in 24-bit color now. ππ
π¦ where this page comes from
- arch rolling: bat-extras 2024.08.24-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms