Change fzf integration to more customizable version

This commit is contained in:
crater2150 2019-07-08 16:11:06 +02:00
parent 2490186ff8
commit 9bcef048c7
2 changed files with 22 additions and 1 deletions

View file

@ -1,6 +1,7 @@
source $(zdotfile zplug/init.zsh)
zplug "MichaelAquilina/zsh-you-should-use"
zplug 'crater2150-zsh/fzf-widgets'
zplug 'molovo/revolver', \
as:command, \
@ -12,3 +13,24 @@ zplug 'zunit-zsh/zunit', \
zplug load
if zplug check 'crater2150-zsh/fzf-widgets'; then
# Map widgets to key
bindkey '\ec' fzf-change-directory
bindkey '^r' fzf-insert-history
bindkey '^xf' fzf-insert-files
bindkey '^xd' fzf-insert-directory
bindkey '^xn' fzf-insert-named-directory
# Start fzf in a tmux pane
FZF_WIDGET_TMUX=1
# use fd for finding directories and files
FZF_CHANGE_DIR_COMMAND="fd -t d"
FZF_INSERT_DIR_COMMAND="fd -t d"
FZF_INSERT_FILES_COMMAND="fd -t f"
FZF_EDIT_FILES_COMMAND="fd -t f"
# modify history command to remove duplicates
FZF_HISTORY_COMMAND="fc -l 1 | sed 's/ *[0-9]* //g' | awk '!seen[\$0]++'"
fi

1
zshrc
View file

@ -51,6 +51,5 @@ echo $PATH | grep -q 'sbin' || . /etc/zsh/zprofile
FZF_ALT_C_COMMAND="fd -t d"
[[ -e /usr/share/doc/fzf/key-bindings.zsh ]] && . /usr/share/doc/fzf/key-bindings.zsh
exists todo && todo