Add fzf-tab plugin for ZSH

Use fzf as autocompletion wrapper for zsh autocompletion
This commit is contained in:
Daniel Siepmann 2023-03-02 12:18:46 +01:00
parent 5200ed955f
commit df544f1e9e
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 14 additions and 0 deletions

View file

@ -70,3 +70,14 @@ zstyle ':completion::complete:git-checkout:argument-rest:' group-order heads-loc
zstyle ':completion::complete:git-checkout:argument-rest:commits' command 'echo'
zstyle ':completion::complete:git-checkout:argument-rest:valid-ref-names' command 'echo'
zstyle ':completion::complete:git-checkout:argument-rest:remote-branch-refs-noprefix' command 'echo'
# Configuration for fzf-tab, see: https://github.com/Aloxaf/fzf-tab#configure
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# switch group using `,` and `.`
zstyle ':fzf-tab:*' switch-group ',' '.'

View file

@ -32,5 +32,8 @@
initExtra = builtins.readFile(../files/zshrc) + ''
zstyle ':completion:*' cache-path ${config.xdg.cacheHome}/zsh-completion/
# Load fzf tab plugin
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.zsh
'';
}