zsh-completions icon indicating copy to clipboard operation
zsh-completions copied to clipboard

Howto: copying completions does not work

Open jtyers opened this issue 2 years ago • 2 comments

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.

jtyers avatar Jun 23 '22 06:06 jtyers

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' ?

syohex avatar Jun 23 '22 06:06 syohex

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: @.***>

jtyers avatar Jul 06 '22 04:07 jtyers