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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# ——————————————————————————————————————————————————————————————————————————————
# fzf configuration
#
# See https://github.com/junegunn/fzf
# ——————————————————————————————————————————————————————————————————————————————
fzf_default_usage='Alt+Y copy to clipboard
Alt+/ move/hide preview'
fzf_ctrl_t_usage='Ctrl+Y select
Alt+Y copy to clipboard
Alt+/ move/hide preview'
fzf_ctrl_r_usage='Alt+R show surrounding entries
Ctrl+R sort by relevance/recency
Alt+Y copy to clipboard'
fzf_alt_c_usage='Alt+Y copy to clipboard
Alt+/ move/hide preview'
# This is used by the Ctrl+T, Ctrl+R, and Alt+C bindings, unless redefined
export FZF_DEFAULT_OPTS="
--walker file,dir,follow,hidden
--walker-skip .git,node_modules
--bind tab:down,btab:up
--bind 'alt-y:execute-silent(wl-copy {..})+abort'
--bind 'alt-/:change-preview-window(down|hidden|)'
--layout reverse --height 50%
--color header:italic
--footer '$fzf_default_usage'
"
# ——————————————————————————————————————————————————————————————————————————————
# Ctrl+T, Ctrl+R, Alt+C function options
#
# See https://github.com/junegunn/fzf#key-bindings-for-command-line
# ——————————————————————————————————————————————————————————————————————————————
# (Ctrl+T) Paste the selected files and directories onto the command-line
export FZF_CTRL_T_OPTS="
--walker file,follow,hidden
--preview 'bat --number --color=always {}'
--bind ctrl-y:toggle
--bind 'alt-/:change-preview-window(down|hidden|)'
--footer '$fzf_ctrl_t_usage'
"
# (Ctrl+R) Paste the selected command from history onto the command-line
export FZF_CTRL_R_OPTS="
--bind 'alt-y:execute-silent(wl-copy {2..})+abort'
--footer '$fzf_ctrl_r_usage'
"
# (Alt+C) `cd` into the selected directory
export FZF_ALT_C_OPTS="
--walker dir,follow,hidden
--preview 'tree -C {}'
--bind 'alt-/:change-preview-window(down|hidden|)'
--footer '$fzf_alt_c_usage'
"
# ——————————————————————————————————————————————————————————————————————————————
# ** fuzzy completion
#
# See https://github.com/junegunn/fzf#customizing-fuzzy-completion-for-bash-and-zsh
# ——————————————————————————————————————————————————————————————————————————————
# ——————————————————————————————————————————————————————————————————————————————
eval "$(fzf --bash)"
|