From 2a52b718c7b1f989665b278f07600f7ffb782f7f Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 22 Apr 2022 13:20:13 +0800 Subject: Integrate fzf into tmux --- .tmux.conf | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to '.tmux.conf') diff --git a/.tmux.conf b/.tmux.conf index f527698..b0961d7 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,3 +1,22 @@ +# Plugins + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-sessionist' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +set -g @plugin 'sainnhe/tmux-fzf' +TMUX_FZF_OPTIONS="-p 80%,80% -m" +TMUX_FZF_PREVIEW=0 +bind f run-shell -b "~/.tmux/plugins/tmux-fzf/scripts/session.sh attach" + +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @continuum-restore 'on' + +if "test ! -d ~/.tmux/plugins/tpm" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" +run '~/.tmux/plugins/tpm/tpm' + # general unbind C-b @@ -18,8 +37,6 @@ set-window-option -g mode-keys vi # navigation -bind f command-prompt -p find-session: 'switch-client -t %%' - bind v split-window -h -c '#{pane_current_path}' bind s split-window -v -c '#{pane_current_path}' unbind '"' @@ -50,17 +67,3 @@ bind H splitw -fhb \; swapp -t ! \; killp -t ! bind L splitw -fh \; swapp -t ! \; killp -t ! bind J splitw -fv \; swapp -t ! \; killp -t ! bind K splitw -fvb \; swapp -t ! \; killp -t ! - -# Plugins - -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'tmux-plugins/tmux-sessionist' -set -g @plugin 'tmux-plugins/tmux-resurrect' - -set -g @plugin 'tmux-plugins/tmux-continuum' -set -g @continuum-restore 'on' - -if "test ! -d ~/.tmux/plugins/tpm" \ - "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" -run '~/.tmux/plugins/tpm/tpm' -- cgit v1.2.3