Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2000 03:03:42 +0200
From:      Neil Blakey-Milner <nbm@mithrandr.moria.org>
To:        Doug Barton <Doug@gorean.org>
Cc:        Akinori -Aki- MUSHA <knu@idaemons.org>, freebsd-hackers@freebsd.org, shige@freebsd.org
Subject:   Re: zsh compdef collection for FreeBSD
Message-ID:  <20000325030342.A80255@mithrandr.moria.org>
In-Reply-To: <Pine.BSF.4.21.0003241648210.6624-100000@dt051n0b.san.rr.com>
References:  <86ln38vutx.wl@archon.local.idaemons.org> <Pine.BSF.4.21.0003241648210.6624-100000@dt051n0b.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri 2000-03-24 (16:52), Doug Barton wrote:
> 	I use the following in my .bashrc. I'm operating on the assumption
> that zsh has aliases of some sort, otherwise feel free to ignore this
> entire post. :)

My ~/.tcsh/os-FreeBSD (which get auto-called by my .tcshrc) has:

/----
setenv PR_FORM ~/.send-pr
# bsd make allows knowing the targets like so:
uncomplete make
complete make 'p@*@`if -e Makefile make -dg1 -q | grep "^[^.#][-_a-z. \t]*:" | awk '"'"'{print $1}'"'"'`@'

# if I have a local copy of the cvs tree, add aliases to easy moving
# into it
alias ncvs 'if ( "\!*" == "" ) then \
	pushd $NCVS/`pwd | cut -f 3- -d/`; \
	else \
	pushd $NCVS/\!*; \
	endif'
complete ncvs "p%*%D:$NCVS/%"
alias uncvs 'popd'

complete pkg_delete 'p%*%D:/var/db/pkg/% %'
complete pkg_info 'p%*%D:/var/db/pkg/% %'

# indt alias compares given code to code given by indent(1)
alias indt 'cat \!\!:1 | indent -st | diff \!\!:1 - | $PAGER'

# show the rlog of a file through favourite pager
alias rl 'rlog \!:1 | $PAGER'
/---

That basically sets up 'make' completion:

(nbm@mithrandr) /usr/src> make
afterdistribute      everything           move-aout-libs
all                  hierarchy            obj
aout-to-elf          includes             objlink
aout-to-elf-build    install              regress
aout-to-elf-install  installkernel        rerelease
...

It also completes pkg_delete and pkg_info:

(nbm@mithrandr) /usr/home/nbm> pkg_delete c
cdd-1.0/            checkpassword-0.81/ cvsup-mirror-1.0/
cdrecord-1.8a33/    cvsup-bin-16.1/     cvsupd-bin-16.1/

ncvs pops me into the cvs tree of the directory I'm in:

(nbm@mithrandr) /usr/src/contrib/cvs> ncvs
(nbm@mithrandr) /home/ncvs/src/contrib/cvs>

uncvs pushes me back.  ncvs could be made much more intelligent, of
course.

Anyway, enough of that.  Time for me to finally learn zsh.

Neil
-- 
Neil Blakey-Milner
nbm@rucus.ru.ac.za


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000325030342.A80255>