blob: eadedd1ed695c60782f4218c7959db3cd77012e0 (
plain) (
blame)
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
|
#!/bin/zsh
(( $+commands[fd] )) || return # find(1) sucks, not worth without fd
# if it's not set yet, set it
[[ -z $fuzzy_command ]] && (( $+commands[fzf] )) && fuzzy_command=fzf
[[ -z $fuzzy_command ]] && (( $+commands[sk] )) && fuzzy_command=sk
local FUZZY_DEFAULT='fd -t f'
local FUZZY_ALT_C='fd -t d'
local FUZZY_CTRL_T="$FUZZY_DEFAULT"
case $fuzzy_command in
fzf)
export FZF_DEFAULT_COMMAND="$FUZZY_DEFAULT"
export FZF_ALT_C_COMMAND="$FUZZY_ALT_C"
export FZF_CTRL_T_COMMAND="$FUZZY_CTRL_T"
. /usr/share/fzf/key-bindings.zsh
. /usr/share/fzf/completion.zsh
;;
sk)
export SKIM_DEFAULT_COMMAND="$FUZZY_DEFAULT"
export SKIM_ALT_C_COMMAND="$FUZZY_ALT_C"
export SKIM_CTRL_T_COMMAND="$FUZZY_CTRL_T"
. /usr/share/skim/key-bindings.zsh
. /usr/share/skim/completion.zsh
;;
esac
|