Created
April 29, 2022 04:10
-
-
Save ideabucket/63066d465ad2cbeb32e6da0c4dd298cb to your computer and use it in GitHub Desktop.
Small fish script you can set as $MANPAGER to view manpages in bbedit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# derived from Dr Drang's bman: https://leancrew.com/all-this/2022/03/last-man-standing/ | |
# set this as your $MANPAGER to have manpages automatically open in bbedit | |
# col -bx to strip the formatting, read -z to make it all one string rather than an array | |
col -bx | read -z manbuffer | |
# lets us set a man-esque window title, e.g. "awk(1)" | |
set manname (string lower (string match -r '^[^)]+\)' $manbuffer)) | |
# this feels painfully non-idiomatic | |
echo $manbuffer | bbedit --new-window --clean --view-top -m "unix-man-page" -t $manname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment