Skip to content

Commit

Permalink
Tweak the height of various fuzzy finders.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Jul 25, 2024
1 parent f7c67c8 commit b471550
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/fuzzy-grep
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ while :; do
done

FZF_EXPECT='f1'
FZF_HEIGHT='20'
INITIAL_QUERY="${*:-}"

# shellcheck disable=SC2016
Expand Down Expand Up @@ -137,6 +138,7 @@ PROMPT_TRANSFORM='

if [ "$VIM_MODE" = 1 ]; then
FZF_EXPECT='ctrl-t,ctrl-v,ctrl-x,f1'
FZF_HEIGHT='100%'
fi

case "$(git rev-parse --is-inside-work-tree 2>/dev/null)" in
Expand Down Expand Up @@ -174,9 +176,9 @@ FZF_OUTPUT=$(\
--disabled \
--delimiter=':' \
--expect="$FZF_EXPECT" \
--height="$FZF_HEIGHT" \
--info='inline-right' \
--multi \
--no-clear \
--preview='(nl -ba {1} | grep --color=always -E "$(printf "|^\s*%s\s.*" {2})") 2>/dev/null' \
--preview-window='+{2}/3,<80(down)' \
--prompt="($(pathshorten)) " \
Expand All @@ -191,7 +193,6 @@ case $SELECTED_ACTION in
if [ "$VIM_MODE" = 1 ]; then
echo "$SELECTED_ACTION"
else
tput rmcup
help
fi

Expand All @@ -204,7 +205,6 @@ if [ "$FZF_STATUS" != 0 ]; then
# 1, signalling that no matches were made, or 130, signalling that it
# was aborted or interrupted by the user.
if [ "$FZF_STATUS" = 1 ] || [ "$FZF_STATUS" = 130 ]; then
tput rmcup
exit
else
exit $FZF_STATUS
Expand Down
3 changes: 3 additions & 0 deletions bin/fuzzy-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ if [ "$LIST_FILES" = 1 ]; then
fi

FZF_EXPECT='ctrl-p,f1'
FZF_HEIGHT='20'
FZF_LABEL='ENTER: Copy snippet ╱ CTRL+P: Print snippet ╱ F1: Help'
IFS=' '
INITIAL_QUERY="${*:-}"

if [ "$VIM_MODE" = 1 ]; then
FZF_EXPECT='ctrl-y,f1'
FZF_HEIGHT='100%'
FZF_LABEL='ENTER: insert ╱ CTRL+Y: yank ╱ F1: help'
fi

Expand All @@ -158,6 +160,7 @@ FZF_OUTPUT=$(\
--border-label-pos='-3:bottom' \
--delimiter='/' \
--expect="$FZF_EXPECT" \
--height="$FZF_HEIGHT" \
--info='inline-right' \
--preview='cat {} 2>/dev/null' \
--preview-window='<80(down)' \
Expand Down

0 comments on commit b471550

Please sign in to comment.