mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 18:38:00 +00:00
[osx] Support custom keyword used by mand
to open man pages in Dash.app
`zstyle` based customization is now avaialble in *zpreztorc*.
This commit is contained in:
parent
8846db9d4d
commit
d6276e8025
@ -3,6 +3,19 @@ OSX
|
|||||||
|
|
||||||
Defines [Mac OS X][1] aliases and functions.
|
Defines [Mac OS X][1] aliases and functions.
|
||||||
|
|
||||||
|
Settings
|
||||||
|
--------
|
||||||
|
|
||||||
|
### Dash Keyword
|
||||||
|
|
||||||
|
To change the keyword used by `mand` to open man pages in [_Dash.app_][2] from
|
||||||
|
its default value of 'manpages', add the following line in *zpreztorc* and
|
||||||
|
replace the **keyword** with the one configured in [_Dash.app_][2].
|
||||||
|
|
||||||
|
```sh
|
||||||
|
zstyle ':prezto:module:osx:man' dash-keyword 'keyword'
|
||||||
|
```
|
||||||
|
|
||||||
Aliases
|
Aliases
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
function mand {
|
function mand {
|
||||||
if (( $# > 0 )); then
|
if (( $# > 0 )); then
|
||||||
open "dash://manpages:$1" 2>/dev/null
|
zstyle -s ':prezto:module:osx:man' dash-keyword 'dashkw' || dashkw='manpages'
|
||||||
|
open "dash://$dashkw:$1" 2>/dev/null
|
||||||
if (( $? != 0 )); then
|
if (( $? != 0 )); then
|
||||||
print "$0: Dash is not installed" >&2
|
print "$0: Dash is not installed" >&2
|
||||||
break
|
break
|
||||||
@ -15,6 +16,8 @@ function mand {
|
|||||||
else
|
else
|
||||||
print 'What manual page do you want?' >&2
|
print 'What manual page do you want?' >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset dashkw
|
||||||
}
|
}
|
||||||
|
|
||||||
mand "$@"
|
mand "$@"
|
||||||
|
@ -81,6 +81,13 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
|
|||||||
# Set the search globbing flags.
|
# Set the search globbing flags.
|
||||||
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
||||||
|
|
||||||
|
#
|
||||||
|
# OS X
|
||||||
|
#
|
||||||
|
|
||||||
|
# Set the keyword used by `mand` to open man pages in Dash.app
|
||||||
|
# zstyle ':prezto:module:osx:man' dash-keyword 'manpages'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Pacman
|
# Pacman
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user