Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding Global Aliases to completion lists
- X-seq: zsh-users 23876
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Jacob Menke <jmenke@xxxxxxxxxx>
- Subject: Re: Adding Global Aliases to completion lists
- Date: Wed, 13 Mar 2019 14:15:13 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=fm2; bh=YrL zIAXQx/nzjCbgpAgcUFUM+LZKP68zKaLgktwvxFw=; b=YsnGf3bxLu8qZIHX46I A078hWw6PKTFPxqm8pKt4DcmYfDUBB3swga55XTVYXgl7I2oLLCtpU2Ft6pW+8Oe 5LPQcdcbH7WdbnVYxonF/Nl/bfeKlj6RUFSfRPYmmU6hFRFky9/FALBgqyjqWYFP 0wcrEzZXquOHBvkd9n3z1IxXNh2f0g73LJnndgzGCnO9AeeQv0VfNJ6h+ulKbJmi 6pEM0riRRVCPtOCk8AMYHGNB1blx37p1NBzSGxNHjKJpYGW28ZYhFrNvdOM+wVEa XdQCajlhikr/UUrCn2RD1t5MdNLplyL6I5WdSq52mRvN/44BQz5fO9pgBnrHBglP zhw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=YrLzIA XQx/nzjCbgpAgcUFUM+LZKP68zKaLgktwvxFw=; b=td3RJPPvpN77Xn4gqfl/14 H2tLgbRwI/DFdko/NuSNbVXtaEcNbzRwOJxlInBXS9JPB5+hCvdyGH+8aKNY977n ly+I9G3/BOh1tQjpfSeC/xzSrANx48ZLXpWNa8IzaEc+squU8+IAz7BStAy54o6J d+Sf02UVUwcoV2WyNRZAkTvq2XRQfuxyeeUfqRTELJvnQtZL5IkPcolOnilT2Ekl +NeudvnIQ6a/yHlPD5oxi2J8JZJtluR2P4pRvTYLqtDOIPpY9wMsyjHCimS6fp80 30og7pWwHeZNcfGzIsLjhrgvY/w6btBOkD2Xlz9DeYyMZkROhkBRlIT3jhBekZTg ==
- In-reply-to: <CAMgxA+cpR3=PRY0zRr_DTTE=rGXf2-_mQxhqv8Zez0L4bvXORw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAMgxA+cpR3=PRY0zRr_DTTE=rGXf2-_mQxhqv8Zez0L4bvXORw@mail.gmail.com>
Jacob Menke wrote on Tue, Mar 12, 2019 at 23:43:51 -0400:
> Hello I was wondering how to add global aliases to completion menu
> selection?
Like this:
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index f8188774d..70b0ddcad 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -29,6 +29,7 @@ else
"functions:shell function:compadd -k 'functions$ffilt'"
'aliases:alias:compadd -Qk aliases'
'suffix-aliases:suffix alias:_suffix_alias_files'
+ 'global-aliases:global alias:compadd -Qk galiases'
'reserved-words:reserved word:compadd -Qk reswords'
'jobs:: _jobs -t'
'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
Note that an alias does not have to be global in order to be able to be used in
command position; that is: depending on what your alias does, it might be
better to simply remove the -g from its definition.
> This is the debugging output from ^Xh when I want to add these completion
> items.
>
> tags in context :completion::complete:-command-::
> commands builtins functions aliases suffix-aliases reserved-words jobs parameters parameters (_command_names _autocd)
Thanks for including this; it made it easy to find the right function.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author