dotfiles/.config/tmux/tmux.conf

125 lines
3.9 KiB
Text
Raw Normal View History

2025-04-06 10:08:57 -05:00
# Defualt Shell
2025-04-02 05:52:16 -05:00
set-option -g default-shell /bin/zsh
2025-04-06 10:08:57 -05:00
# Enable 256-color and true-color (24-bit) support in tmux
set -g default-terminal "screen-256color" # Set terminal type for 256-color support
set -ga terminal-overrides ",*256col*:Tc" # Override to enable true-color for compatible terminals
2025-03-28 14:47:40 -05:00
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
setw -g mode-keys vi
bind -T copy-mode-vi WheelUpPane send -X scroll-up
bind -T copy-mode-vi WheelDownPane send -X scroll-down
#set-option -g aggressive-resize off
2025-04-06 10:08:57 -05:00
set -g mouse on
2024-05-26 05:54:35 -05:00
set -g set-clipboard on
set -g @yank_selection_mouse 'clipboard'
set -g @yank_selection 'clipboard'
2025-04-06 10:08:57 -05:00
set -g status-justify centre
set -g detach-on-destroy off
set -g status-interval 3
set -g allow-passthrough on
2025-03-28 14:47:40 -05:00
2025-04-06 10:08:57 -05:00
#Change Tmux keybindings
2024-05-26 05:54:35 -05:00
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
2025-02-28 17:59:44 -06:00
2024-05-26 05:54:35 -05:00
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
2025-04-07 05:13:44 -05:00
set-option -g @ssh-split-h-key "v"
set-option -g @ssh-split-v-key 'h'
2025-03-13 14:36:04 -05:00
set-option -g @ssh-split-keep-cwd "true"
set-option -g @ssh-split-keep-remote-cwd "true"
2024-05-26 05:54:35 -05:00
2025-04-06 10:08:57 -05:00
# Resource Config
bind r source-file ~/.config/tmux/tmux.conf
2025-03-12 05:09:03 -05:00
# resize windows
bind -n C-M-h resize-pane -L 5
bind -n C-M-l resize-pane -R 5
bind -n C-M-k resize-pane -U 5
bind -n C-M-j resize-pane -D 5
2024-05-26 05:54:35 -05:00
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
2025-03-28 14:47:40 -05:00
bind -n M-H previous-window
bind -n M-L next-window
2024-05-26 05:54:35 -05:00
2025-04-06 10:08:57 -05:00
# Plugins
2024-05-26 05:54:35 -05:00
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
2024-06-02 09:31:22 -05:00
set -g @plugin 'catppuccin/tmux'
2024-05-26 05:54:35 -05:00
set -g @plugin 'tmux-plugins/tmux-yank'
2024-08-13 06:21:36 -05:00
set -g @plugin 'pschmitt/tmux-ssh-split'
2025-01-10 05:38:08 -06:00
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
2025-04-06 10:08:57 -05:00
set -g @plugin 'tmux-plugins/tmux-resurrect'
2024-08-17 17:51:01 +00:00
set -g @catppuccin_flavor 'mocha'
2025-04-07 15:44:59 -05:00
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_text ' #W'
set -g @catppuccin_window_current_text ' #W'
set -g status-left "#[fg=#{@thm_crust},bg=#{@thm_mauve}] #S "
set -g status-right "#[fg=#{@thm_crust},bg=#{@thm_mauve}] #(git rev-parse --abbrev-ref HEAD) "
set -g window-status-format "##I"
set -g window-status-current-format "##I"
2025-03-28 14:47:40 -05:00
2025-04-06 10:08:57 -05:00
# Resurrect
set -g @resurrect-capture-pane-contents 'on'
2024-05-26 05:54:35 -05:00
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel "xsel -i --clipboard"
2025-04-06 17:27:18 -05:00
unbind '"'
unbind %
2025-04-06 10:08:57 -05:00
#bind '"' split-window -v -c "#{pane_current_path}"
#bind % split-window -h -c "#{pane_current_path}"
2025-01-25 08:10:58 -06:00
bind c new-window -c "#{pane_current_path}"
2024-05-26 05:54:35 -05:00
2025-05-28 05:37:15 -05:00
bind n run 'zsh -c ". $HOME/.config/scripts/sessions.sh new"'
2025-07-17 06:47:25 -05:00
bind s display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh switch"
bind d display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh delete"
2025-04-06 10:08:57 -05:00
bind w display-popup -E -w 50% -h 50% ". $HOME/.config/scripts/sessions.sh window"
2025-04-02 17:41:37 -05:00
2025-04-04 05:34:41 -05:00
bind g display-popup -E -w 80% -h 75% "lazygit"
2025-04-05 07:00:35 -05:00
bind k display-popup -E -w 80% -h 75% "k9s"
2025-04-06 10:08:57 -05:00
bind f display-popup -E -w 80% -h 75% "yazi"
2025-04-04 05:34:41 -05:00
2025-04-06 17:27:18 -05:00
bind T if-shell -F '#{==:#{session_name},popup}' {
2025-04-04 05:34:41 -05:00
detach-client
} {
2025-04-08 07:01:07 -05:00
display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E ". $HOME/.config/scripts/sessions.sh popup"
2025-04-04 05:34:41 -05:00
}
2025-03-12 05:09:03 -05:00
2025-04-06 17:27:18 -05:00
bind S if-shell -F '#{==:#{session_name},scratch}' {
detach-client
} {
2025-04-08 07:05:48 -05:00
display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E ". $HOME/.config/scripts/sessions.sh scratch"
2025-04-06 17:27:18 -05:00
}
2025-04-07 15:44:59 -05:00
bind N if-shell -F '#{==:#{session_name},notes}' {
detach-client
} {
2025-04-08 06:48:07 -05:00
display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E ". $HOME/.config/scripts/sessions.sh notes"
2025-04-07 15:44:59 -05:00
}
2024-05-26 05:54:35 -05:00
run '~/.tmux/plugins/tpm/tpm'