Browse Source

Add capability to browse man pages in Dash.app

master
Sorin Ionescu 11 years ago
parent
commit
00e12b7a98
  1. 3
      modules/osx/README.md
  2. 4
      modules/osx/functions/_manb_mand_manp
  3. 21
      modules/osx/functions/mand

3
modules/osx/README.md

@ -15,6 +15,7 @@ Aliases @@ -15,6 +15,7 @@ Aliases
Functions
---------
- `mand` opens _man_ pages in [_Dash.app_][2].
- `manp` opens _man_ pages in _Preview.app_.
- `pfd` prints the current _Finder_ directory.
- `pfs` prints the current _Finder_ selection.
@ -28,6 +29,6 @@ Authors @@ -28,6 +29,6 @@ Authors
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: http://www.apple.com/macosx/
[2]: http://kapeli.com/dash
[3]: http://www.iterm2.com/
[4]: https://github.com/sorin-ionescu/prezto/issues

4
modules/osx/functions/_manb → modules/osx/functions/_manb_mand_manp

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
#compdef manp
#compdef mand manp
#autoload
#
# Completes manp.
# Completes mand and manp.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>

21
modules/osx/functions/mand

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
#
# Opens man pages in Dash.app.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
function mand {
if (( $# > 0 )); then
open "dash://manpages:$1" 2>/dev/null
if (( $? != 0 )); then
print "$0: Dash is not installed" >&2
break
fi
else
print 'What manual page do you want?' >&2
fi
}
mand "$@"
Loading…
Cancel
Save