Files
dotfiles/tmux/.tmux.conf
Christian Nieves 8dc9131c46 uhhhh
2025-03-05 22:07:33 -06:00

179 lines
5.7 KiB
Bash

unbind C-b
set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set -g prefix C-a
bind C-a send-prefix
set -g mouse off
set -g prefix `
bind-key ` send-prefix
set -sg escape-time 0
# Hide pane with Prefix-h
bind-key h break-pane -d -n _hidden_pane
bind-key H join-pane -s $.1
# Tick -> Ctrl-A, sets prefix to Ctrl-A
bind-key C-a set-option -g prefix C-a
# Ctrl-A -> Ctrl-b, sets prefix to Tick
bind-key C-b set-option -g prefix `
set-option -g history-limit 100000000
set-option -g status-position bottom
set-option -g bell-action other
set-option -g visual-bell on
set -g base-index 1
set -g pane-base-index 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
set -g @thumbs-osc52 '1'
# tmux-256color instead of screen-256color enables italics
set -g default-terminal "tmux-256color"
# Tc enables true color
set -ag terminal-overrides ",*256col*:colors=256:Tc"
set -as terminal-features ',rxvt-unicode-256color:clipboard'
# set -g default-shell zsh
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind -n C-b send-keys -R \; clear-history \; send-keys C-l
set -g status on
set-option -g status-interval 2
bind Escape confirm-before "kill-server"
# set-option -g automatic-rename on
# set-option -g automatic-rename-format '#{?#{m/r:^(/google/src)?/cloud/,#{pane_current_path}},#{s|^(/google/src)?/cloud/[^/]+/([^/]+).+$|\2|:pane_current_path},#{b:pane_current_path}}'
set-window-option -g xterm-keys on
set-option -g xterm-keys on
set -g status-keys vi
set-option -g allow-passthrough on
set -s set-clipboard on
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default
set -g @override_copy_command 'lemonade copy'
# transfer copied text to attached terminal with yank
bind-key -T copy-mode-vi C-c send -X copy-pipe-no-clear "lemonade copy"
# allowd pane-navigation while in copy-mode
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
setw -g monitor-activity on
bind-key v split-window -h -c '#{pane_current_path}'
bind-key s split-window -v -c '#{pane_current_path}'
bind -n M-s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# bind -n C-Space select-pane -D \; resize-pane -Z
bind -n M-z resize-pane -Z
bind -n M-j resize-pane -D 5
bind -n M-k resize-pane -U 5
bind -n M-h resize-pane -L 5
bind -n M-l resize-pane -R 5
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Ctrl-Shift arrow to swap windows
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# swap window to left or right
bind-key -r < swap-window -t -1\; select-window -t -1
bind-key -r > swap-window -t +1\; select-window -t +1
# loop through current window's panes while zoomed
bind -r "'" select-pane -t .+1 \; resize-pane -Z
bind -r ";" select-pane -t .+1 \; resize-pane -Z \; copy-mode
bind-key C-a set-option -g prefix C-a
# No delay for escape key press
set -sg escape-time 0
run ~/.tmux/plugins/tmux/catppuccin.tmux
# text for the window when inactive
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text '#{?#{m/r:^(/google/src)?/cloud/,#{pane_current_path}},#{s|^(/google/src)?/cloud/[^/]+/([^/]+).+$|\2|:pane_current_path},#{b:pane_current_path}}'
# text for the window when active
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text '#{?#{m/r:^(/google/src)?/cloud/,#{pane_current_path}},#{s|^(/google/src)?/cloud/[^/]+/([^/]+).+$|\2|:pane_current_path},#{b:pane_current_path}}'
set -g @catppuccin_icon_window_bell "󰂞"
# Make the status line pretty and add some modules
set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_application}"
set -agF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_uptime}"
set -agF status-right "#{E:@catppuccin_status_battery}"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'xamut/tmux-weather'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cowboy' # Kill process in pane w/ prefix+*
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'catppuccin/tmux#v2.1.2'
set -g @continuum-restore 'on'
set -g @resurrect-dir '$HOME/.tmux/resurrect'
set -g @catppuccin_flavour 'macchiato' # or frappe, macchiato, mocha
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'