Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (38 sloc) 1.17 KB
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt always_to_end
setopt auto_menu
setopt complete_in_word
setopt listpacked
setopt nobeep # STFU
setopt nocorrect
setopt nullglob
setopt pushdignoredups # don't duplicate completions
setopt recexact # recognise exact, ambiguous matches
# Case-insensitive and fuzzy-like matching for completion
# 'lic<TAB>' completes LICENSE; 'bundle<TAB>' completes 'vimrc.bundles'
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' list-colors ''
# vi mode
bindkey jk vi-cmd-mode
# fzf-git
join-lines() {
local item
while read item; do
echo -n "${(q)item} "
done
}
bind-git-helper() {
local char
for c in $@; do
eval "fzf-g$c-widget() { local result=\$(fzf-g$c | join-lines); zle reset-prompt; LBUFFER+=\$result }"
eval "zle -N fzf-g$c-widget"
eval "bindkey '^g^$c' fzf-g$c-widget"
done
}
bind-git-helper f b t r h
unset -f bind-git-helper
# Host-specific local configs (e.g., ~/.zshrc.laptop.local)
for f in ~/.zshrc.*.local; do source "$f"; done
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# vim: ft=sh