Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $PAGER, man vs info - was: Re: zsh-lovers
- X-seq: zsh-users 11755
- From: "Matt Wozniski" <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: $PAGER, man vs info - was: Re: zsh-lovers
- Date: Thu, 9 Aug 2007 05:44:22 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jPkGacDjkg3wvPx6Ad0E1wQyVISwe9Dc/+bRSLBVl0Ut3m8gAfdv1UPRv4KumxdVmVFkPa0rMtDduRb9ZbaTnXuERkgl2yBmjk65o9dCIn7sAI7Gm1JE6lphMWG/8mXawL3UV+8BYoxY9+k/2dpj+lW4rrw3XYNDfTvStMY+iSY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Q1ROLJI1wuBCirHaWeykfmVqzhV7oWAj0tzV65O7WEf1476/VLhlMexF9uRDZG/9NoO6GKVtldIMo/wezq7hvQJMSTGArltq4bUHE4oVlB7zIcH1p2cM9ygOx+40t8PLYJn+5p8xw9peSDsGxReQb+6IU88aY6EP4b37ypLTbHA=
- In-reply-to: <20070809081256.GA18046@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <fb3648c60708042251g594b3863qbc0345f77cff07b0@xxxxxxxxxxxxxx> <f94pi6$kir$1@xxxxxxxxxxxxx> <20070808064949.63130.qmail@xxxxxxxxxxx> <f9cs7t$5mv$1@xxxxxxxxxxxxx> <18106.17749.611759.820818@xxxxxxxxxxxxxxxxxxxx> <20070808225016.90637.qmail@xxxxxxxxxxx> <07f901c7da19$4ea59320$ebf0b960$@com> <18106.24334.377557.621807@xxxxxxxxxxxxxxxxxxxx> <20070809025458.GH28316@localdomain> <20070809081256.GA18046@xxxxxxxxxxxxxxxxxxx>
> > [jae_0]cat ~/bin/pager
> > #!/bin/sh
>
> > col -b | view --cmd 'let no_plugin_maps = 1' \
> > -c 'set ft=man nomod nolist' -c 'runtime! macros/less.vim' \
> > -c "set ls=0" -c 'noremap <Up> <C-Y>' -c 'noremap <Down> <C-E>' -
Well, I wasn't going to bother jumping in on this thread, but since someone
brought up using vim as a manpager...
I use the wonderful vim script found here:
http://www.vim.org/scripts/script.php?script_id=489
Combined with these quick functions:
~>which man
man () {
[[ $# -eq 0 ]] && return 1
view -c "Man $*" -c "silent! only"
}
~>which info
info () {
[[ $# -eq 1 ]] || return 1
view -c "Man $1.i" -c "silent! only"
}
~>which perldoc
perldoc () {
[[ $# -eq 1 ]] || return 1
view -c "Man $1.pl" -c "silent! only"
}
This lets me use any of the below forms to open vim with some documentation:
man printf
man printf 3
man 3 printf
man 'printf(3)'
info coreutils
perldoc perlfaq1
Then, I can use the useful vim keys for navigation. For instance,
doing "man
zshall" from a shell, vim will open with the zshall manpage.
Then, if I put
the cursor on zshparam and type an uppercase K, vim will jump right to the
zshparam man page. Or, ":Man ctime" will open a new manpage.
On my widescreen monitor, I'm a big fan of a vertically-split vim window with a
manpage on one side and the stuff I'm writing on the other. Useful for all the
times that I want to check exactly what errors can cause pthread_cond_init to
fail...
Beats pinfo, info, more, less, and most all hands-down. :)
Although, I still hold on to less and most for general-purpose pagers. It's
much nicer to have a "|less" than a "|vim -" because less doesn't need to wait
for the whole input stream to be read before it starts displaying something,
and vim does.
~Matt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author