diff --git a/configs/tmux/plugins/tmux-continuum b/configs/tmux/plugins/tmux-continuum new file mode 160000 index 0000000..3e4bc35 --- /dev/null +++ b/configs/tmux/plugins/tmux-continuum @@ -0,0 +1 @@ +Subproject commit 3e4bc35da41f956c873aea716c97555bf1afce5d diff --git a/configs/tmux/plugins/tmux-resurrect b/configs/tmux/plugins/tmux-resurrect new file mode 160000 index 0000000..a2ddfb9 --- /dev/null +++ b/configs/tmux/plugins/tmux-resurrect @@ -0,0 +1 @@ +Subproject commit a2ddfb96b94bb64a7a2e3f5fa2a7c57dce8ad579 diff --git a/configs/tmux/plugins/tmux-sensible b/configs/tmux/plugins/tmux-sensible new file mode 160000 index 0000000..25cb91f --- /dev/null +++ b/configs/tmux/plugins/tmux-sensible @@ -0,0 +1 @@ +Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa diff --git a/configs/tmux/plugins/tmux-themepack b/configs/tmux/plugins/tmux-themepack new file mode 160000 index 0000000..7c59902 --- /dev/null +++ b/configs/tmux/plugins/tmux-themepack @@ -0,0 +1 @@ +Subproject commit 7c59902f64dcd7ea356e891274b21144d1ea5948 diff --git a/configs/tmux/plugins/tpm b/configs/tmux/plugins/tpm new file mode 160000 index 0000000..fc412cb --- /dev/null +++ b/configs/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit fc412cbdf765175ea9f3380db6b9e1b1603a68a7 diff --git a/configs/tmux/tmux.conf b/configs/tmux/tmux.conf new file mode 100644 index 0000000..4cdae2a --- /dev/null +++ b/configs/tmux/tmux.conf @@ -0,0 +1,64 @@ +set -g prefix C-a +unbind C-b +bind-key C-a send-prefix + +set -g default-terminal "screen-256color" +set-option -sa terminal-overrides ",xterm-kitty:RGB" + +unbind % +bind | split-window -h + +unbind '"' +bind _ split-window -v + +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +bind -r j resize-pane -D 5 +bind -r k resize-pane -U 5 +bind -r l resize-pane -R 5 +bind -r h resize-pane -L 5 + +bind -r m resize-pane -Z + +set -g mouse on + +set-window-option -g mode-keys vi + +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection + +unbind -T copy-mode-vi MouseDragEnd1Pane + +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" +bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+' + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R +bind-key -T copy-mode-vi 'C-\' select-pane -l +bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+ + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'jimeh/tmux-themepack' +set -g @themepack 'powerline/default/yellow' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' + +set -g @resurrect-capture-pane-contents 'on' +set -g @continuum-restore 'on' + +run '~/.config/tmux/plugins/tpm/tpm' +