Skip to content

Commit 9fdcf39

Browse files
committed
added fzf and zoxide integrations
1 parent d11412b commit 9fdcf39

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

dotfiles/zshrc

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,12 @@ DISABLE_UNTRACKED_FILES_DIRTY="true"
7171
ZSH_DISABLE_COMPFIX=true
7272

7373
# Plugins
74-
zinit ice as"completion"
75-
zinit snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker
76-
7774
zinit snippet OMZP::git
7875
zinit snippet OMZP::pyenv
7976
zinit snippet OMZP::dotenv
8077
zinit snippet OMZP::sudo
8178
zinit snippet OMZP::golang
8279
zinit snippet OMZP::common-aliases
83-
zinit snippet OMZP::pyenv
8480

8581
zstyle ':omz:plugins:nvm' autoload yes
8682
zstyle ':omz:plugins:nvm' silent-autoload yes # optionally remove the output generated by NVM when autoloading
@@ -90,12 +86,15 @@ zinit snippet OMZP::colored-man-pages
9086
zinit snippet OMZP::systemd
9187
zinit snippet OMZP::themes
9288
zinit snippet OMZP::perms
89+
zinit ice atload'[ ! -d $ZSH_CACHE_DIR/completions ] && mkdir $ZSH_CACHE_DIR/completions'
90+
zinit snippet OMZP::docker
9391
zinit snippet OMZP::docker-compose
9492
zinit snippet OMZP::kubectl
9593

9694
zinit light zsh-users/zsh-syntax-highlighting
9795
zinit light zsh-users/zsh-autosuggestions
9896
zinit light zsh-users/zsh-completions
97+
zinit light Aloxaf/fzf-tab
9998

10099
##
101100
## correct only spelling of commands
@@ -116,6 +115,12 @@ eval "$(starship init zsh)"
116115
## custom completions
117116
##
118117

118+
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
119+
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
120+
zstyle ':completion:*' menu no
121+
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
122+
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
123+
119124
if [ -n "$HOMEBREW_PREFIX" ]; then
120125
fpath=("$HOMEBREW_PREFIX/share/zsh-completions" $fpath)
121126
fpath=("$HOMEBREW_PREFIX/share/zsh/site-functions" $fpath)
@@ -128,9 +133,37 @@ fpath=("$ZSH_COMPLETION_DIR" $fpath)
128133

129134
## TODO: there is an issue https://github.com/zdharma-continuum/zinit/issues/654
130135
# [ -f "$HOME/.zsh_completion" ] && source "$HOME/.zsh_completion"
131-
# autoload -Uz compinit && compinit -u
136+
autoload -Uz compinit && compinit -u
137+
zinit cdreplay -q
138+
139+
##
140+
## keybindings
141+
##
142+
143+
bindkey '^p' history-search-backward
144+
bindkey '^n' history-search-forward
145+
146+
##
147+
## history
148+
##
149+
HISTSIZE=5000
150+
HISTFILE=$HOME/.zsh_history
151+
SAVEHIST=$HISTSIZE
152+
HISTDUP=erase
153+
setopt appendhistory
154+
setopt sharehistory
155+
setopt hist_ignore_space
156+
setopt hist_ignore_all_dups
157+
setopt hist_save_no_dups
158+
setopt hist_ignore_dups
159+
setopt hist_find_no_dups
160+
161+
##
162+
## shell integrations
163+
##
132164

133-
# zinit cdreplay -q
165+
source <(fzf --zsh)
166+
eval "$(zoxide init --cmd cd zsh)"
134167

135168
##
136169
## PATH without duplicates

0 commit comments

Comments
 (0)