update fzf completion for zsh
This commit is contained in:
parent
82f734ad0c
commit
f33c57f1a4
1 changed files with 35 additions and 2 deletions
|
|
@ -116,9 +116,42 @@ setopt hist_find_no_dups
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||||
zstyle ':completion:*' menu no
|
zstyle ':completion:*' menu no
|
||||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
zstyle ':fzf-tab:*' show-group full
|
||||||
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
zstyle ':fzf-tab:*' continuous-trigger '/'
|
||||||
|
zstyle ':fzf-tab:*' fzf-flags --height=10% --layout=reverse --info=inline --ansi -i --preview-window=right:60%:wrap
|
||||||
|
|
||||||
|
# ── Previewers ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview \
|
||||||
|
'eza -lha --color=always --icons --git --no-permissions --tree --level 3 --group-directories-first --total-size $realpath'
|
||||||
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview \
|
||||||
|
'eza -lha --color=always --icons --git --no-permissions --tree --level 3 --group-directories-first --total-size $realpath'
|
||||||
|
|
||||||
|
# systemctl
|
||||||
|
zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word'
|
||||||
|
|
||||||
|
# git
|
||||||
|
zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-preview \
|
||||||
|
'git diff $word | bat -plman --color=always'
|
||||||
|
zstyle ':fzf-tab:complete:git-log:*' fzf-preview \
|
||||||
|
'git log --decorate --graph --color=always $word'
|
||||||
|
zstyle ':fzf-tab:complete:git-help:*' fzf-preview \
|
||||||
|
'git help $word | bat -plman --color=always'
|
||||||
|
zstyle ':fzf-tab:complete:git-show:*' fzf-preview \
|
||||||
|
'case "$group" in
|
||||||
|
"commit tag") git show --color=always $word ;;
|
||||||
|
*) git show --color=always $word | bat -plman --color=always ;;
|
||||||
|
esac'
|
||||||
|
zstyle ':fzf-tab:complete:git-checkout:*' fzf-preview \
|
||||||
|
'case "$group" in
|
||||||
|
"modified file") git diff $word | bat -plman --color=always ;;
|
||||||
|
"recent commit object name") git show --color=always $word | bat -plman --color=always ;;
|
||||||
|
*) git log --decorate --graph --color=always $word ;;
|
||||||
|
esac'
|
||||||
|
|
||||||
|
# TLDR
|
||||||
|
zstyle ':fzf-tab:complete:tldr:argument-1' fzf-preview 'tldr --color always $word'
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ ZSH Options │
|
# │ ZSH Options │
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue