From dadd4850b32b697e1324e3d9e47f74c01be15500 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Wed, 20 Apr 2022 23:55:21 +0800 Subject: Add tmux plugins --- .gitmodules | 3 +++ .tmux.conf | 32 ++++++++++++++++++++++++++------ .tmux/plugins/tmux-continuum | 1 + .tmux/plugins/tmux-resurrect | 1 + .tmux/plugins/tmux-sensible | 1 + .tmux/plugins/tmux-sessionist | 1 + .tmux/plugins/tpm | 1 + 7 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .gitmodules create mode 160000 .tmux/plugins/tmux-continuum create mode 160000 .tmux/plugins/tmux-resurrect create mode 160000 .tmux/plugins/tmux-sensible create mode 160000 .tmux/plugins/tmux-sessionist create mode 160000 .tmux/plugins/tpm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c1680c5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".tmux/plugins/tpm"] + path = .tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm/ diff --git a/.tmux.conf b/.tmux.conf index de5fdda..fe3eee7 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -20,8 +20,8 @@ set-window-option -g mode-keys vi bind f command-prompt -p find-session: 'switch-client -t %%' -bind | split-window -h -c '#{pane_current_path}' -bind - split-window -v -c '#{pane_current_path}' +bind v split-window -h -c '#{pane_current_path}' +bind s split-window -v -c '#{pane_current_path}' unbind '"' unbind % @@ -32,13 +32,33 @@ bind k select-pane -U bind l select-pane -R ## resize the pane -bind H resize-pane -L 5 -bind L resize-pane -R 5 -bind K resize-pane -U 5 -bind J resize-pane -D 5 +bind < resize-pane -L 5 +bind > resize-pane -R 5 +bind - resize-pane -D 5 +bind + resize-pane -U 5 # copy and paste like vim bind -T copy-mode-vi 'v' send -X begin-selection bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" if-shell 'test -f "$HOME/.local/.tmux.conf"' 'source ~/.local/.tmux.conf' + +bind C-j command-prompt -p "join pane from: " "join-pane -h -s '%%'" + +# move pane to the far right/left/bottom/top +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' + +run '~/.tmux/plugins/tpm/tpm' diff --git a/.tmux/plugins/tmux-continuum b/.tmux/plugins/tmux-continuum new file mode 160000 index 0000000..fc2f31d --- /dev/null +++ b/.tmux/plugins/tmux-continuum @@ -0,0 +1 @@ +Subproject commit fc2f31d79537a5b349f55b74c8ca69abaac1ddbb diff --git a/.tmux/plugins/tmux-resurrect b/.tmux/plugins/tmux-resurrect new file mode 160000 index 0000000..6050d2d --- /dev/null +++ b/.tmux/plugins/tmux-resurrect @@ -0,0 +1 @@ +Subproject commit 6050d2d8d8a9052c6a30e88fa27e6d5e3844e52a diff --git a/.tmux/plugins/tmux-sensible b/.tmux/plugins/tmux-sensible new file mode 160000 index 0000000..5d089e4 --- /dev/null +++ b/.tmux/plugins/tmux-sensible @@ -0,0 +1 @@ +Subproject commit 5d089e418efb1a00f47654014ed085deb3d0c878 diff --git a/.tmux/plugins/tmux-sessionist b/.tmux/plugins/tmux-sessionist new file mode 160000 index 0000000..09ec86b --- /dev/null +++ b/.tmux/plugins/tmux-sessionist @@ -0,0 +1 @@ +Subproject commit 09ec86be38eae98ffc27bd0dde605ed10ae0dc89 diff --git a/.tmux/plugins/tpm b/.tmux/plugins/tpm new file mode 160000 index 0000000..b699a7e --- /dev/null +++ b/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit b699a7e01c253ffb7818b02d62bce24190ec1019 -- cgit v1.2.3