add tmux config

This commit is contained in:
Lucas Barbieri 2023-01-16 14:35:41 -03:00
parent 73c39aed01
commit 78e313751e
6 changed files with 69 additions and 0 deletions

@ -0,0 +1 @@
Subproject commit 3e4bc35da41f956c873aea716c97555bf1afce5d

@ -0,0 +1 @@
Subproject commit a2ddfb96b94bb64a7a2e3f5fa2a7c57dce8ad579

@ -0,0 +1 @@
Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa

@ -0,0 +1 @@
Subproject commit 7c59902f64dcd7ea356e891274b21144d1ea5948

@ -0,0 +1 @@
Subproject commit fc412cbdf765175ea9f3380db6b9e1b1603a68a7

64
configs/tmux/tmux.conf Normal file
View File

@ -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'