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

Re: compctl -v



Bernd Eggink writes:
 > 	compctl -D -v

This means that all default completions should use parameter names and
only parameter names, which is probably not what you intended.

 > these commands are nicely completed:
 > 
 > 	vared xyz<TAB>
 > 	print $xyz<TAB>

Completion following a $ is a special case and doesn't require compctl
to activate it.

 > 	ls xyz<TAB>
 > 
 > all shell parameters starting with 'xyz' also show up, which IMHO is
 > nonsense. Any way to prevent this, and get parameter names completed
 > only if preceded by '$' or 'vared'?

Yes; you want to get rid of that compctl -D, and instead use

     compctl -v vared

A minimal set of sensible compctls using only built-in completions is:

compctl -B builtin
compctl -m command
compctl -v declare integer local readonly read
compctl -aBFw disable
compctl -daBFw enable
compctl -c exec sched whence where -
compctl -F functions unfunction
compctl -Nv getln
compctl -a unalias
compctl -cn unhash
compctl -k signals trap
# These last few are enabled by default in 3.0, but not in 3.1.2 and later
compctl -b bindkey
compctl -v export typeset unset vared
compctl -o setopt unsetopt
compctl -c which

The argument for leaving out all default compctls from 3.1.2+, last time I
heard it, is that the above set isn't "good enough" by comparison to the
collection in Misc/compctl-examples to be worth having.  I've been saying
for at least a year now that I think that's a silly reason to have zsh
out-of-the-box default to completing nothing but file names, but I guess
I'm beating a dead horse.



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