sh: Add default fzf options and binds
tab and shift-tab will select up and down, ctrl-g moves to the first entry, ctrl-t toggles the preview window on and off, ctrl-d/ctrl-u scroll through the preview window. By default, a preview window of the contents of whatever file is currently selected will be displayed. I would rather have the preview hidden by default, but it is hidden in the default options it becomes hard to show it automatically again for individual commands, so this seems a better compromise.
This commit is contained in:
parent
cd52e47e22
commit
ca692d30d0
1 changed files with 4 additions and 0 deletions
|
@ -46,3 +46,7 @@ export SHELL=${SHELL:-/bin/bash}
|
|||
if [ "$(find /usr/share/terminfo -name "$TERMINAL*" | wc -l)" -eq 0 ] || [ -z "$TERMINAL" ]; then
|
||||
export TERM=xterm
|
||||
fi
|
||||
|
||||
if exist fzf; then
|
||||
export FZF_DEFAULT_OPTS="--bind 'tab:toggle+down,shift-tab:toggle+up,ctrl-g:top,ctrl-t:toggle-preview,ctrl-d:preview-half-page-down,ctrl-u:preview-half-page-up' --color=light -1 -m --delimiter : --preview 'nl {1}' --preview-window +{2}-5"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue