# GENERAL SETTINGS set -g history-limit 5000 set -g buffer-limit 20 set -sg escape-time 0 set -g display-time 1500 set -g remain-on-exit off set -g repeat-time 300 setw -g allow-rename on setw -g automatic-rename on set -g set-titles on set -g set-titles-string '#T' setw -g aggressive-resize on set -g prefix 'C-a' set -g mouse off setw -g mode-keys vi set -g destroy-unattached on setw -g monitor-activity on set -g visual-activity on set-option -g default-shell /bin/zsh # UNDERCURL COMPATIBILITY set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # STATUS BAR SETTINGS set -g mode-style "fg=default,bg=blue" set -g message-style "fg=green,bg=black" set -g status-style "fg=gray,bg=black" # set -g status-right "" # set -g status-left "" setw -g window-status-current-style "fg=black,bold,bg=blue" setw -g window-status-current-format " #I " setw -g window-status-activity-style "fg=gray" setw -g pane-active-border-style "fg=blue" set -g status off set -g status-interval 1 set -g status-position bottom set -g status-justify left set -g status-right-length 100 # CLIPBOARD CMD yank="xsel -i --clipboard" # BINDINGS unbind 'C-b' unbind '$' unbind ',' unbind '%' unbind '"' unbind '}' unbind '{' unbind '[' unbind ']' unbind "'" unbind 'n' unbind 'p' unbind 'l' unbind 'M' unbind 'o' unbind '&' unbind '#' unbind '=' unbind 'z' unbind 'Space' unbind 'M-Up' unbind 'M-Down' unbind 'M-Right' unbind 'M-Left' bind 'C-a' send-prefix bind 'C-l' clear-history bind 'h' select-pane -L bind 'j' select-pane -D bind 'k' select-pane -U bind 'l' select-pane -R bind 'C-r' source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display "Config reloaded" bind 'r' command-prompt -I "#{window_name}" "rename-window '%%'" bind 'R' command-prompt -I "#{session_name}" "rename-session '%%'" bind 'c' new-window -c "#{pane_current_path}" bind '|' split-window -h -c "#{pane_current_path}" bind '_' split-window -v -c "#{pane_current_path}" bind -r 'C-[' previous-window bind -r 'C-]' next-window bind -r '[' select-pane -t :.- bind -r ']' select-pane -t :.+ bind -r 'Tab' last-window # cycle thru MRU tabs bind -r 'C-o' swap-pane -D bind '+' resize-pane -Z bind 'L' command-prompt -p "Link window from (session:window): " "link-window -s %% -a" bind 'Space' if '[ #{pane_index} -eq 2 ]' \ 'swap-pane -s "!"' \ 'select-pane -t:.1 ; swap-pane -d -t 1 -s "!"' bind 'x' kill-pane bind 'X' kill-window bind 'C-x' confirm-before -p "kill other windows? (y/n)" "kill-window -a" bind 'Q' confirm-before -p "kill-session #S? (y/n)" kill-session bind 'C-u' command-prompt -p "Session to merge with: " \ "run-shell 'yes | head -n #{session_windows} | xargs -I {} -n 1 tmux movew -t %%'" bind 'd' detach bind 'D' if -F '#{session_many_attached}' \ 'confirm-before -p "Detach other clients? (y/n)" "detach -a"' \ 'display "Session has only 1 client attached"' bind 'C-s' if -F '#{s/off//:status}' 'set status off' 'set status on' bind 'm' setw monitor-activity \; display-message 'Monitor window activity [#{?monitor-activity,ON,OFF}]' bind 'M' if -F '#{monitor-silence}' \ 'setw monitor-silence 0 ; display-message "Monitor window silence [OFF]"' \ 'command-prompt -p "Monitor silence: interval (s)" "setw monitor-silence %%"' bind 'p' paste-buffer bind 'C-p' choose-buffer bind 'C-c' copy-mode bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "$yank" bind -T copy-mode-vi 'Y' send-keys -X copy-line-and-cancel \; run "tmux save-buffer - | $yank" # These binds allow toggling of keybind handling by the root tmux session # This is helpful when nesting tmux sessions (i.e. when using SSH) bind -T root F12 \ set prefix None \;\ set key-table off \;\ if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\ refresh-client -S bind -T off F12 \ set -u prefix \;\ set -u key-table \;\ refresh-client -S # PLUGINS run $XDG_CONFIG_HOME/tmux/tmux-fzf-url/fzf-url.tmux