Skip to content

Commit

Permalink
feat: finish fzf integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mrolli committed Oct 7, 2024
1 parent 2a0e46b commit 8f7dc5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 11 additions & 2 deletions config/zsh/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ fi

autoload -U compinit && compinit -d $ZCACHEDIR/zcompdump

# Replay recored compdef calls
zinit cdreplay -q

_comp_options+=(globdots) # with hidden files
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' completer _extensions _complete
zstyle ':completion:*' menu select
zstyle ':completion:*' menu no
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
Expand All @@ -27,6 +30,7 @@ zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' complete-options true
zstyle ':completion:*' rehash true
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'

# Activate 1password autocompletion if 1password is avaialble
if command -v op &>/dev/null; then
Expand All @@ -38,9 +42,14 @@ if command -v wezterm &>/dev/null; then
eval "$(wezterm shell-completion --shell zsh)"
fi

# Active fzf autocompletion and shell integration
if command -v fzf &>/dev/null; then
eval "$(fzf --zsh)"
fi

# Activate azure autocompletion if az is avaialble
if command -v az &>/dev/null; then
autoload bashcompinit && bashcompinit
autoload autload -U +X bashcompinit && bashcompinit && \
source $HOMEBREW_PREFIX/etc/bash_completion.d/az
fi

Expand Down
4 changes: 1 addition & 3 deletions config/zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source "$ZINIT_HOME/zinit.zsh"
zinit ice depth=1; zinit light zsh-users/zsh-completions
zinit ice depth=1; zinit light zsh-users/zsh-autosuggestions
zinit ice depth=1; zinit light jeffreytse/zsh-vi-mode
zinit ice depth=1; zinit light Aloxaf/fzf-tab
# See https://wezfurlong.org/wezterm/shell-integration.html
zinit snippet https://raw.githubusercontent.com/wez/wezterm/main/assets/shell-integration/wezterm.sh
# keep syntax highlighting last
Expand Down Expand Up @@ -76,8 +77,5 @@ PATH=~/.local/bin:$PATH
# Make vagrant vcloud token available
[ -f "$HOME/.vagrant.d/vcloud_token.sh" ] && source "$HOME/.vagrant.d/vcloud_token.sh"

# Setup fzf shell integration
eval "$(fzf --zsh)"

# build prompt
eval "$(starship init zsh)"

0 comments on commit 8f7dc5d

Please sign in to comment.