-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfzfrc
More file actions
45 lines (38 loc) · 2.02 KB
/
fzfrc
File metadata and controls
45 lines (38 loc) · 2.02 KB
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
# vim:ft=zsh
# Custom FZF overrides loaded from conf.d/70-integrations.zsh.
# Base FZF initialization is handled in $ZDOTDIR/.fzf.zsh.
[[ -o interactive ]] || return 0
if [[ "$ZDOTS_THEME" == "dracula" ]]; then
export FZF_DEFAULT_OPTS='--tiebreak=begin,length --color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4'
elif [[ "$ZDOTS_THEME" == dracula-pro* ]]; then
export FZF_DEFAULT_OPTS='--tiebreak=begin,length --color=fg:#F8F8F2,bg:#22212C,hl:#9580FF --color=fg+:#F8F8F2,bg+:#454158,hl+:#9580FF --color=info:#FFCA80,prompt:#8AFF80,pointer:#FF80BF --color=marker:#FF80BF,spinner:#FFCA80,header:#7970A9'
elif [[ "$ZDOTS_THEME" == "nord" ]]; then
export FZF_DEFAULT_OPTS='--tiebreak=begin,length --color=fg:#e5e9f0,bg:#2e3440,hl:#81a1c1 --color=fg+:#e5e9f0,bg+:#3b4252,hl+:#81a1c1 --color=info:#eacb8a,prompt:#81a1c1,pointer:#b48ead --color=marker:#a3be8c,spinner:#b48ead,header:#a3be8c'
fi
export FZF_COMPLETION_TRIGGER='**'
# In completion menus, use Tab to accept highlighted match and return to prompt.
export FZF_COMPLETION_OPTS='--bind=tab:accept'
export FZF_CTRL_T_OPTS="--select-1 --exit-0 --preview 'bat -n --color=always {}'"
if command -v tree >/dev/null 2>&1; then
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
else
export FZF_ALT_C_OPTS="--preview 'ls -la {}'"
fi
if command -v fd >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND='fd --hidden --follow --exclude .git .'
elif command -v rg >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND='rg --files --hidden -g "!.git"'
else
export FZF_DEFAULT_COMMAND='find . -type f'
fi
if (( ${+widgets[fzf-history-widget]} )); then
fzf-history-widget-accept() {
fzf-history-widget
zle accept-line
}
zle -N fzf-history-widget-accept
bindkey '^X^R' fzf-history-widget-accept
bindkey -M emacs '^X^R' fzf-history-widget-accept
bindkey -M viins '^X^R' fzf-history-widget-accept
bindkey -M vicmd '^X^R' fzf-history-widget-accept
fi