BATMAN(1)

πŸ“¦ version 2024.08.24, in arch rolling

πŸ’… 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 for batman. This is treated like BAT_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 through bat's config file or the BAT_THEME environment variable. Not all themes provide colours for flags, and it's a known issue.
  • You can overriding the theme for batman by wrapping it in a function that sets BAT_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