This commit is contained in:
2026-01-31 21:30:00 +08:00
parent 21129ab5b9
commit e86f9d47e7
2 changed files with 11 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ alias -g P="2>&1| pygmentize -l pytb"
alias dud='du -d 1 -h'
(( $+commands[duf] )) || alias duf='du -sh *'
(( $+commands[fd] )) || alias fd='find . -type d -name'
# (( $+commands[fd] )) || alias fd='find . -type d -name'
alias ff='find . -type f -name'
alias h='history'

View File

@@ -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"
}