# Screen-like Control unbind C-b set-option -g prefix C-a bind-key C-a send-prefix set -g base-index 1 # start windows numbering at 1 setw -g pane-base-index 1 # make pane numbering consistent with windows bind m set -gF mouse "#{?mouse,off,on}" # Toggle mouse on/off setw -g automatic-rename on # rename window to reflect current program set -g renumber-windows on # renumber windows when a window is closed set -g default-terminal xterm-256color set-option -ga terminal-overrides ",xterm-256color:Tc" set-option -g status-position bottom set -g status-keys vi set -g history-limit 100000 set-option -g set-titles on set-option -g focus-events on setw -g mode-keys vi setw -g monitor-activity on # copy mode bind Enter copy-mode # enter copy mode run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true' # copy to X11 clipboard if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"' if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"' # buffers bind b list-buffers # list paste buffers bind p paste-buffer # paste from the top paste buffer bind P choose-buffer # choose which buffer to paste from # create session bind C-c new-session # find session bind -r f command-prompt -p find-session 'switch-client -t %%' bind-key -n F3 choose-session # switch to last active window bind Tab last-window # Split window bind-key v split-window -h -c "#{pane_current_path}" bind-key s split-window -v -c "#{pane_current_path}" # pane resizing bind -r H resize-pane -L 6 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 # Smart pane switching with awareness of Vim splits and fzf. # See: https://github.com/christoomey/vim-tmux-navigator is_vim_or_fzf="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$' \ || ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE 'fzf'" # check for fzf bind-key -n 'C-h' if-shell "$is_vim_or_fzf" 'send-keys C-h' 'select-pane -L' bind-key -n 'C-j' if-shell "$is_vim_or_fzf" 'send-keys C-j' 'select-pane -D' bind-key -n 'C-k' if-shell "$is_vim_or_fzf" 'send-keys C-k' 'select-pane -U' bind-key -n 'C-l' if-shell "$is_vim_or_fzf" 'send-keys C-l' 'select-pane -R' bind > swap-pane -D # swap current pane with the next one bind < swap-pane -U # swap current pane with the previous one set -g display-panes-time 2000 set -g pane-base-index 1 # Use Alt-arrow keys without prefix key to switch panes bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D # Alt arrow to switch windows bind -n M-p previous-window bind -n M-n next-window set -sg escape-time 0 # No delay for escape key press set -sg repeat-time 300 # increase repeat timeout # Start a floating pane bind-key p if-shell -F '#{==:#{session_name},floating}' { detach-client } { popup -d '#{pane_current_path}' -xC -yC -w80% -h80% 'tmux new -A -s floating' } bind-key T run-shell 'tmux_popup tig' # Reload tmux config bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' bind-key -n F2 run-shell "tmux neww tmux-sessionizer.sh" # tmux-prefix-highlight settings set -g @prefix_highlight_fg 'red' set -g @prefix_highlight_bg 'blue' set -g @prefix_highlight_show_copy_mode 'on' set -g @prefix_highlight_show_sync_mode 'on' # tmux-open settings # set -g @open-S 'https://www.google.com/' set -g @open 'o' set -g @open-editor 'C-e' # tmux-thumgs settings set -g @thumbs-command 'echo -n {} | ccopy' # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters # --> Catppuccin thm_bg="#1e1e28" thm_fg="#dadae8" thm_cyan="#c2e7f0" thm_black="#15121c" thm_gray="#332e41" thm_magenta="#c6aae8" thm_pink="#e5b4e2" thm_red="#e38c8f" thm_green="#b1e3ad" thm_yellow="#ebddaa" thm_blue="#a4b9ef" thm_orange="#f9c096" thm_black4="#575268" # ----------------------------=== Theme ===-------------------------- # status set -g status-position bottom set -g status "on" set -g status-bg "${thm_bg}" set -g status-style bg=default set -g status-justify "centre" set -g status-left-length "90" set -g status-right-length "90" set -g status-left-style NONE set -g status-right-style NONE setw -g window-status-separator "" # messages set -g message-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" set -g message-command-style fg="${thm_cyan}",bg="${thm_gray}",align="centre" # panes set -g pane-border-style fg="${thm_gray}" set -g pane-active-border-style fg="${thm_blue}" # windows setw -g window-status-activity-style fg="${thm_fg}",bg="${thm_bg}",none setw -g window-status-separator "" setw -g window-status-style fg="${thm_fg}",bg="${thm_bg}",none # --------=== Statusline set -g status-left "" set -g status-right "" # current_dir setw -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I  #W #F" setw -g window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #S | #I #W #F" # --------=== Modes setw -g clock-mode-colour "${thm_blue}" setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" # List of plugins set -g @plugin 'tmux-plugins/tmux-urlview' set -g @plugin 'tmux-plugins/tmux-prefix-highlight' set -g @plugin 'tmux-plugins/tmux-open' set -g @plugin 'fcsonline/tmux-thumbs' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm'