zsh-completions
zsh-completions copied to clipboard
Howto: copying completions does not work
The howto copying completions section states you can copy a completion from one command to another using:
compdef cmd1=cmd2
This doesn't appear to work. In my case I have an alias md
:
❯ alias md
md='m env=dev'
Given a makefile which works with normal completion via make
:
❯ make [TAB]
[make target]
PHONY
clean
dist
[--snip--]
I would expect the same behaviour for md
, but it doesn't suggest make targets, only files, as if no completion had been defined for it. I'm running compdef md=make
.
I cannot reproduce your issue.
I suppose you don't need to define compdef
because zsh completion works against aliases.
How about defining alias like alias md='make env=dev'
?
Ah, that's true. It'll be causing an issue in my case because I have a wrapper function for make, so zsh is not seeing it as an invocation to make any more
On Thu, 23 Jun 2022, 07:59 Shohei YOSHIDA, @.***> wrote:
I cannot reproduce your issue.
I suppose you don't need to define compdef because zsh completion works against aliases. How about defining alias like alias md='make env=dev' ?
— Reply to this email directly, view it on GitHub https://github.com/zsh-users/zsh-completions/issues/874#issuecomment-1164027492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRVU3YZXXJMUHQCTTWNRF3VQQDLVANCNFSM5ZTET4VQ . You are receiving this because you authored the thread.Message ID: @.***>