From bf65e8cd12b0477a916ed16fa6d9d3ff9a78c824 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 31 Mar 2020 22:18:09 +0900 Subject: [fzf-tmux] Add option to start fzf in tmux popup window Requires latest tmux built from source (e.g. brew install tmux --HEAD) Examples: # 50%/50% width and height on the center of the screen fzf-tmux -p # 80%/80% fzf-tmux -p80% # 80%/40% fzf-tmux -p80%,40% # Separate -w and -h fzf-tmux -w80% -h40% # 80%/40% at position (0, 0) fzf-tmux -w80% -h40% -x0 -y0 You can configure key bindings and fuzzy completion to open in tmux popup window like so: FZF_TMUX_OPTS='-p 80%' --- shell/key-bindings.fish | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'shell/key-bindings.fish') diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index c4bad838..73a07334 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -1,3 +1,16 @@ +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.fish +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + # Key bindings # ------------ function fzf_key_bindings @@ -84,8 +97,10 @@ function fzf_key_bindings function __fzfcmd test -n "$FZF_TMUX"; or set FZF_TMUX 0 test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% - if [ $FZF_TMUX -eq 1 ] - echo "fzf-tmux -d$FZF_TMUX_HEIGHT" + if [ -n "$FZF_TMUX_OPTS" ] + echo "fzf-tmux $FZF_TMUX_OPTS -- " + else if [ $FZF_TMUX -eq 1 ] + echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " else echo "fzf" end -- cgit v1.2.3