From 371eae89cc2b619c4e21c91d1ce2afcb6385ed6f Mon Sep 17 00:00:00 2001 From: Patrick Fong Date: Sat, 6 Apr 2024 21:12:26 -0700 Subject: [PATCH] [fzf] use FZF_DEFAULT_OPTS_FILE instead of FZF_DEFAULT_OPTS Newly implemented in https://github.com/junegunn/fzf/pull/3618 Reduces work keeping fzf default opts consistent across shells Allows changing opts without restarting or reloading shell --- .bashrc | 2 +- .config/fish/config.fish | 2 +- .config/fzf | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .config/fzf diff --git a/.bashrc b/.bashrc index 3e2bd44..cb0d9ed 100644 --- a/.bashrc +++ b/.bashrc @@ -16,7 +16,7 @@ export HISTTIMEFORMAT='%F %T ' shopt -s histverify # don't immediately execute commands from history but copy them onto command line shopt -s histappend # append to bash history instead of overwriting -export FZF_DEFAULT_OPTS="--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker='*'" +export FZF_DEFAULT_OPTS_FILE="$HOME/.config/fzf" test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" diff --git a/.config/fish/config.fish b/.config/fish/config.fish index e0e42fd..162962d 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -32,7 +32,7 @@ set -g fish_greeting fzf_configure_bindings --directory=\cf --git_log=\cl --git_status=\cs --processes=\cp set fzf_diff_highlighter delta --paging=never --width=20 -set -x FZF_DEFAULT_OPTS --cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*" +set -x FZF_DEFAULT_OPTS_FILE ~/.config/fzf # n: start in type-to-nav mode # A: disable automatically jumping into directories when in type-to-nav mode diff --git a/.config/fzf b/.config/fzf new file mode 100644 index 0000000..c7364c1 --- /dev/null +++ b/.config/fzf @@ -0,0 +1 @@ +--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*" \ No newline at end of file