correct way to use fzf binary, key-bindings and completion with zinit #359
-
For the moment, I managed to get it working with this snippet: zi ice wait lucid from"gh-r" as"program" mv"fzf* -> fzf" pick"fzf/fzf"
zi light junegunn/fzf-bin
zinit ice wait lucid from"gh-r" nocompile src'shell/key-bindings.zsh' sbin \
dl'https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion;
https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh -> key-bindings.zsh;
https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1 -> $ZPFX/share/man/man1/fzf-tmux.1;
https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1 -> $ZPFX/share/man/man1/fzf.1'
zinit light junegunn/fzf Is there any shorter way to do it? Honestly, it felt like quite an achievement to get fzf working as I didn't find any documentation to do so (outside of just the binary itself) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
I condensed the URLs using brace expansion (which can be optimized further). zi for \
as'command' \
dl="$(print -c https://raw.githubusercontent.com/junegunn/fzf/master/{shell/{'key-bindings.zsh;','completion.zsh -> _fzf;'},man/{'man1/fzf.1 -> $ZPFX/share/man/man1/fzf.1;','man1/fzf-tmux.1 -> $ZPFX/share/man/man1/fzf-tmux.1;'}})" \
from'gh-r' \
null \
pick'fzf' \
src'key-bindings.zsh' \
@junegunn/fzf |
Beta Was this translation helpful? Give feedback.
-
This plugin also does a wonderful job: https://github.com/joshskidmore/zsh-fzf-history-search |
Beta Was this translation helpful? Give feedback.
I condensed the URLs using brace expansion (which can be optimized further).