-
Notifications
You must be signed in to change notification settings - Fork 0
/
.fzf.zsh
36 lines (29 loc) · 1.04 KB
/
.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
29
30
31
32
33
34
35
36
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
# Custom Key bindings
# ------------
# default shortcut is CTRL + t
# The trigger sequence instead of the default **
export FZF_COMPLETION_TRIGGER='ff'
# Turn fzf instance into a different process (neovim)
alias ffvim="fzf --multi --bind 'enter:become(nvim {})'"
# 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 --follow --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}