Skip to content

Commit

Permalink
feat: improve default user interface
Browse files Browse the repository at this point in the history
Add a few fzf options to improve the default user interface. Users can
override the defaults using the FZF_DEFAULT_OPTS environment variable.
For example, to get the prompt back to the bottom of the screen:
    export FZF_DEFAULT_OPTS="--no-reverse"

See `man fzf` for more information about configuring the tool.
  • Loading branch information
benelan committed May 18, 2024
1 parent 5ae01a4 commit d891a07
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,11 @@ fi
# The following fzf options are shared by all commands. They are prepended to
# the FZF_DEFAULT_OPTS environment variable so they can be overridden by users.
export FZF_DEFAULT_OPTS='
--no-hscroll --no-exit-0 --header-lines=1
--no-hscroll --no-exit-0 --header-lines=1 --cycle --reverse --delimiter=" "
--preview-window="right,50%,wrap,~2,<60(down,40%,wrap)"
--delimiter=" "
--preview-label="(alt+P: toggle preview) (alt+H: toggle hints)"
--bind="alt-P:toggle-preview"
--bind="alt-H:toggle-header"
--bind="alt-P:toggle-preview" --bind="alt-H:toggle-header"
--color "fg:#ebdbb2,fg+:#ebdbb2,bg:#282828,bg+:#3c3836,hl:#d3869b:bold,hl+:#d3869b,info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#928374,label:#83a598"
--bind="ctrl-r:reload(eval \"$FZF_DEFAULT_COMMAND\")"
--bind="alt-1:reload(eval \"$FZF_DEFAULT_COMMAND -L100\")"
--bind="alt-2:reload(eval \"$FZF_DEFAULT_COMMAND -L200\")"
Expand All @@ -125,7 +124,7 @@ export FZF_DEFAULT_OPTS='
--bind="alt-7:reload(eval \"$FZF_DEFAULT_COMMAND -L700\")"
--bind="alt-8:reload(eval \"$FZF_DEFAULT_COMMAND -L800\")"
--bind="alt-9:reload(eval \"$FZF_DEFAULT_COMMAND -L900\")"
'" $FZF_DEFAULT_OPTS --no-select-1 --ansi --no-multi"
'"$FZF_DEFAULT_OPTS"' --no-select-1 --ansi --no-multi'
# Overriding the three options above breaks gh-fzf, so append them instead.

# --------------------------------------------------------------------- }}}
Expand Down Expand Up @@ -466,7 +465,7 @@ $global_binds
"

FZF_DEFAULT_COMMAND="GH_FORCE_TTY=$gh_columns gh release $release_template list -L $GH_FZF_DEFAULT_LIMIT $*" \
FZF_DEFAULT_COMMAND="GH_FORCE_TTY=$gh_columns gh release list $release_template -L $GH_FZF_DEFAULT_LIMIT $*" \
fzf \
--preview='GH_FORCE_TTY=$FZF_PREVIEW_COLUMNS gh release view {1} '"$repo_flag" \
--header="$release_header" \
Expand Down

0 comments on commit d891a07

Please sign in to comment.