Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Few newbie questions..

Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

Bart, hi, and thanks for quick reply.

> On Aug 17,  3:55am, Jukka Lehti wrote:
> }
> } How I can make zsh3 add slash when doing:
> } cd ..[TAB]? bash does this automatically and IMHO
> } it's really useful.
> Tab and slash are each one keystroke.  Hence not
> really useful.

With a Finnish keyboard you have to use Shift+7
to get /, so that's the reason for my question.

> compctl -g '*(/)' + -x 'S[..]' -k '(..)' -qS/ -- cd

Yes, this does just what I was thinking about!

> You also haven't said whether you're using "new"
> completion (`compinit'
> in your .zshrc somewhere), or 3.0-style compctl. 
> The two do mix, but
> new completion will always be tried first if it is
> enabled.  Or you might
> want to define a "completion widget," which is
> another thing entirely.
> So it'd be better if you told us what you want zsh
> to do when you type
> a tab after the man command, and let us tell you how
> to get there; or at
> least give us a few more details of what you're
> trying to do.

Ok, sorry for inadequate information. So, I have in my
~/.zshrc: [hopefully you can see this..]

# man page completion
man_glob () {
	local a
	read -cA a
	if [[ $a[2] = -s ]]	# Or [[ $a[2] = [0-9]* ]] for BSD
		reply=( ${^$(man -w | sed 's/:/
/g')}/man$a[3]/$1*$2(N:t:r) )
		reply=( ${^$(man -w | sed 's/:/
/g')}/man*/$1*$2(N:t:r) )
compctl -K man_glob -f -x 'C[-1,-P]' -m - \
	'R[-*l*,;]' -g '*.(man|[0-9nlpo](|[a-z]))' + -g
'*(-/)' -- man

When I type for example 'man local' and hit tab
I can choose from:

locale.1 locale.3 locale.7

I prefer the man completion to show me the section
numbers (although I have remove the number before
pressing enter since man can't find e.g. locale.1).
With zsh4 'man local[TAB]' doesn't list the
alternatives, so that's why I don't like.

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger

Messages sorted by: Reverse Date, Date, Thread, Author