-
Notifications
You must be signed in to change notification settings - Fork 0
/
.fzf.zsh
28 lines (24 loc) · 818 Bytes
/
.fzf.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Setup fzf
# ---------
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
export PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null
# Use fd (https://github.com/sharkdp/fd) instead of the default find
# command for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
fd --hidden --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --exclude ".git" . "$1"
}
# Key bindings
# ------------
source "$HOME/.fzf/shell/key-bindings.zsh"
source "$HOME/.config/fzf/fzf.sh"
source "$HOME/.config/fzf/pip-fzf.sh"