zsh fzf
This commit is contained in:
@@ -53,7 +53,7 @@ alias -g P="2>&1| pygmentize -l pytb"
|
|||||||
|
|
||||||
alias dud='du -d 1 -h'
|
alias dud='du -d 1 -h'
|
||||||
(( $+commands[duf] )) || alias duf='du -sh *'
|
(( $+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 ff='find . -type f -name'
|
||||||
|
|
||||||
alias h='history'
|
alias h='history'
|
||||||
|
|||||||
@@ -11,7 +11,16 @@ fi
|
|||||||
# alt-f to search files with fzf
|
# alt-f to search files with fzf
|
||||||
function fzf-file-widget() {
|
function fzf-file-widget() {
|
||||||
local selected_file
|
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)
|
selected_file=$(eval $command_to_run)
|
||||||
LBUFFER+="$selected_file"
|
LBUFFER+="$selected_file"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user