Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _gnu_generic for aliases
- X-seq: zsh-users 21601
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: _gnu_generic for aliases
- Date: Wed, 1 Jun 2016 22:30:30 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=HtB2KObEEiSvQrDZxiNNqX8HllhJqgyaSa4dmFseWb8=; b=RKwS6fVnm4sxv1Pj4s+aobCK0n22nuAHbrunGY+TrdH8umyVR2qeIyvDejK5Kyh7Iq HH1nHBQVNLUKTS0XK+u2qSW4dW+Q/4qdmXE90RwwfEJeLqI7rhOPHsi4kD/q+z4rfegM mRH3RdslWcd66r+hA7vXb5S/iLlcvfZvpH/rxdBMHk2tdmUvb9mR90O3Dz1gfv3G6fSz 1v7SyfVDVu6n6A55dU/GKBvMjesEv+1dgFR/uXgdcxbz5ATc509ip8+Gi697BNQ2hzb5 EVX7k+eF847N2tPzgpbkjs6A8ZxpUXe0cu66EJyr2trLyvC88eH4xV8EVCDqozrecsqB +kHw==
- In-reply-to: <573D7E67.10600@mathphys.fsk.uni-heidelberg.de>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <573D7E67.10600@mathphys.fsk.uni-heidelberg.de>
On May 19, 10:50am, Paul Seyfert wrote:
}
} I crosschecked that also
}
} compdef _gnu_generic fancyalias
}
} does not result in any suggestions. My understanding is that the
} _gnu_generic function does not know about the fancyalias / I cannot use
} the fancyalias inside the _gnu_generic function.
}
} Is there a way to make _gnu_generic work for aliases?
Have you tried "setopt complete_aliases" ?
Unfortunately it's not easily possible to have it both ways, that is, to
treat an alias as something you can "compdef" and ALSO have the alias be
expanded to use the completion for the command it eventually becomes.
This might work a lot of the time:
setopt complete_aliases
_expand_alias_and_complete() {
if [[ -o complete_aliases && -n $aliases[$words[1]] ]]; then
words[1]=( $aliases[$words[1]] )
_complete
else
return 1
fi
}
zstyle ':completion:*' completer _complete __expand_alias_and_complete
Needs tweaking based on the rest of your current "completer" style, but
hopefully you get the idea.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author