zplug / zplug

:hibiscus: A next-generation plugin manager for zsh
MIT License
5.81k stars 232 forks source link

Fail install fzf-bin from gh-r with aliased grep #412

Open bootleq opened 7 years ago

bootleq commented 7 years ago

Minimal zshrc (with less than 30 lines)

alias grep='grep -n'

source $ZPLUG_HOME/init.zsh

zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:"fzf"

zplug check || zplug install
zplug load

Step to reproduce

  1. Set alias grep as grep -n (--line-number)
  2. Start to install fzf-bin from gh-r
  3. Zplug will report Failed to install junegunn/fzf-bin
kopinions commented 4 years ago

have this issue fixed?

ddnexus commented 3 years ago

This one works fine (maybe even without rename-to:fzf:)

zplug "junegunn/fzf", from:github, as:command, rename-to:fzf, hook-build:"./install --all"
zakame commented 3 years ago

I use a variation of the above:

zplug "junegunn/fzf", hook-build:"./install --bin", use:"shell/*.zsh", defer:2

if zplug check junegunn/fzf; then
    FZF_DEFAULT_OPTS="--multi --reverse --inline-info"
    PATH=$HOME/.zplug/repos/junegunn/fzf/bin:$PATH
fi

This lets me not update ~/.zshrc via fzf hook-build (as its tracked elsewhere) and still customize fzf behavior.

Mr-Tao commented 3 years ago

I’ve settled with slightly modified @zakame’s version

zplug "junegunn/fzf", \
  hook-build:"./install --bin && ln -frs $ZPLUG_REPOS/junegunn/fzf/bin/fzf* $ZPLUG_BIN", \
  use:"shell/*.zsh"