Unverified Commit 16050ab8 authored by Richard Mitchell's avatar Richard Mitchell Committed by GitHub

feat(macos): allow multiple man pages in `man-preview` (#11365)

parent 0ca8907f
......@@ -25,7 +25,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
| `pxd` | Return the current Xcode project directory |
| `cdx` | `cd` to the current Xcode project directory |
| `quick-look` | Quick-Look a specified file |
| `man-preview` | Open a specified man page in Preview app |
| `man-preview` | Open man pages in Preview app |
| `showfiles` | Show hidden files in Finder |
| `hidefiles` | Hide the hidden files in Finder |
| `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on |
......
......@@ -224,9 +224,10 @@ function quick-look() {
}
function man-preview() {
local location
# Don't let Preview.app steal focus if the man page doesn't exist
location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview
local page
for page in "${(@f)"$(man -w $@)"}"; do
command mandoc -Tpdf $page | open -f -a Preview
done
}
compdef _man man-preview
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment