zsh fzf
This commit is contained in:
@@ -11,7 +11,16 @@ fi
|
||||
# alt-f to search files with fzf
|
||||
function fzf-file-widget() {
|
||||
local selected_file
|
||||
local command_to_run="$FZF_DEFAULT_COMMAND | fzf"
|
||||
local command_to_run="fzf"
|
||||
if (( $+commands[fd] )); then
|
||||
command_to_run="fd --type f --hidden --exclude .git | fzf"
|
||||
elif (( $+commands[rg] )); then
|
||||
command_to_run='rg --files --hidden --glob "!.git/*" | fzf'
|
||||
elif (( $+commands[ag] )); then
|
||||
command_to_run='ag -l --hidden -g "" --ignore .git | fzf'
|
||||
else
|
||||
command_to_run='find . -type f | fzf'
|
||||
fi
|
||||
selected_file=$(eval $command_to_run)
|
||||
LBUFFER+="$selected_file"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user