Update .config/tmux/tmux.conf

This commit is contained in:
2024-01-04 13:14:00 +01:00
parent 74495599a0
commit 0c5d7cc4a7

View File

@@ -1,66 +1,69 @@
# default shell # default shell
set-option -g default-shell /bin/zsh set-option -g default-shell /bin/zsh
set-option -g status-position top set-option -g status-position top
# tmux theme # tmux theme
source-file "${XDG_CONFIG_HOME}/tmux/tmux.theme" source-file "${XDG_CONFIG_HOME}/tmux/tmux.theme"
# Remap prefix from 'C-b' to 'C-a' # Remap prefix from 'C-b' to 'C-a'
unbind C-b unbind C-b
set-option -g prefix C-a set-option -g prefix C-a
bind-key C-a send-prefix bind-key C-a send-prefix
# split panes using | and - # split panes using | and -
unbind '"' unbind '"'
unbind % unbind %
bind | split-window -h -c "#{pane_current_path}" # -c openes it in the current directory bind | split-window -h -c "#{pane_current_path}" # -c openes it in the current directory
bind - split-window -v -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}"
# History limit increase # History limit increase
set -g history-limit 50000 set -g history-limit 50000
# reload config # reload config
bind C-r source-file ${XDG_CONFIG_HOME}/tmux/tmux.conf \; display "Config reloaded!" bind C-r source-file ${XDG_CONFIG_HOME}/tmux/tmux.conf \; display "Config reloaded!"
# switch panes using Alt-arrow without prefix - detect when we are in vim and switch panes there instead # switch panes using Alt-arrow without prefix - detect when we are in vim and switch panes there instead
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind -n M-Left if-shell "$is_vim" 'send-keys M-Left' 'select-pane -L' bind -n M-Left if-shell "$is_vim" 'send-keys M-Left' 'select-pane -L'
bind -n M-Right if-shell "$is_vim" 'send-keys M-Right' 'select-pane -R' bind -n M-Right if-shell "$is_vim" 'send-keys M-Right' 'select-pane -R'
bind -n M-Up if-shell "$is_vim" 'send-keys M-Up' 'select-pane -U' bind -n M-Up if-shell "$is_vim" 'send-keys M-Up' 'select-pane -U'
bind -n M-Down if-shell "$is_vim" 'send-keys M-Down' 'select-pane -D' bind -n M-Down if-shell "$is_vim" 'send-keys M-Down' 'select-pane -D'
# vim style switch pane # vim style switch pane
bind h select-pane -L bind h select-pane -L
bind j select-pane -D bind j select-pane -D
bind k select-pane -U bind k select-pane -U
bind l select-pane -R bind l select-pane -R
bind -r H resize-pane -L 5 bind -r H resize-pane -L 5
bind -r J resize-pane -D 5 bind -r J resize-pane -D 5
bind -r K resize-pane -U 5 bind -r K resize-pane -U 5
bind -r L resize-pane -R 5 bind -r L resize-pane -R 5
# Enable mouse control (clickable windows, panes, resizable panes) # Decrease ESC timeout timing for faster nvim mode exit
set -g mouse on set -sg escape-time 10
# Address vim mode switching delay (http://superuser.com/a/252717/65504) # Enable mouse control (clickable windows, panes, resizable panes)
set -s escape-time 0 set -g mouse on
# Timeout for display messages (in milliseconds) # Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -g display-time 1000 set -s escape-time 0
# Plugins # Timeout for display messages (in milliseconds)
set -g @plugin 'tmux-plugins/tpm' set -g display-time 1000
#set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' # Plugins
set -g @plugin 'tmux-plugins/tpm'
bind -T copy-mode C-c send -X copy-pipe-no-clear "xclip -sel clip" #set -g @plugin 'tmux-plugins/tmux-sensible'
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xclip -sel clip" set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Fix numbering for easy switching bind -T copy-mode C-c send -X copy-pipe-no-clear "xclip -sel clip"
set -g base-index 1 bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xclip -sel clip"
setw -g pane-base-index 1
set -g renumber-windows on # Fix numbering for easy switching
set -g base-index 1
## init tpm setw -g pane-base-index 1
run ${XDG_CONFIG_HOME}/tmux/plugins/tpm/tpm set -g renumber-windows on
## init tpm
run ${XDG_CONFIG_HOME}/tmux/plugins/tpm/tpm