mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
feat(macos): allow multiple man pages in man-preview
(#11365)
This commit is contained in:
parent
0ca8907f0e
commit
16050ab80e
2 changed files with 5 additions and 4 deletions
|
@ -25,7 +25,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||||
| `pxd` | Return the current Xcode project directory |
|
| `pxd` | Return the current Xcode project directory |
|
||||||
| `cdx` | `cd` to the current Xcode project directory |
|
| `cdx` | `cd` to the current Xcode project directory |
|
||||||
| `quick-look` | Quick-Look a specified file |
|
| `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 |
|
| `showfiles` | Show hidden files in Finder |
|
||||||
| `hidefiles` | Hide the hidden files in Finder |
|
| `hidefiles` | Hide the hidden files in Finder |
|
||||||
| `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on |
|
| `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on |
|
||||||
|
|
|
@ -224,9 +224,10 @@ function quick-look() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function man-preview() {
|
function man-preview() {
|
||||||
local location
|
local page
|
||||||
# Don't let Preview.app steal focus if the man page doesn't exist
|
for page in "${(@f)"$(man -w $@)"}"; do
|
||||||
location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview
|
command mandoc -Tpdf $page | open -f -a Preview
|
||||||
|
done
|
||||||
}
|
}
|
||||||
compdef _man man-preview
|
compdef _man man-preview
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue