## Prefix like in screen set -g prefix 'C-a' ## Use xterm keys (makes eg. Ctrl+Arrow navigate words) set-window-option -g xterm-keys on ## List of plugins # For this to work you need to install https://github.com/tmux-plugins/tpm set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' # Those two allow continuous saving and restoring of tmux sessions set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' # Intuitive bindings for splitting panes set -g @plugin 'tmux-plugins/tmux-pain-control' # Integrations with system clipboard set -g @plugin 'tmux-plugins/tmux-yank' # Easier session management set -g @plugin 'tmux-plugins/tmux-sessionist' # Man in a split set -g @plugin 'knakayama/tmux-man' # Peek-a-boo set -g @plugin 'knakayama/tmux-newline-detector' ## Plugin configuration set -g @continuum-restore 'on' set -g @continuum-save-interval '5' set -g @resurrect-capture-pane-contents 'on' set -g @yank_selection 'primary' set -g @man-size '40%' set -g @man-orientation 'h' set -g @man-shell-interactive 'off' # True colors (via: https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ ) set -g default-terminal "screen-256color" # tell Tmux that outside terminal supports true color set -ag terminal-overrides ",alacritty:RGB" ## Windows style set-option -g status-style fg=yellow,bg=default set-window-option -g pane-active-border-style '' ## A bit more space in right status bar set -g status-right-length 50 ## Rename windows to fit current application setw -g automatic-rename on # Use zsh regardless of default settings if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh' # switch panes using Alt-arrow without prefix 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 ## Mouse On by default set -g mouse on # PageUp/PageDown works for scrolling bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" bind-key -T copy-mode-vi PPage send-keys -X page-up bind-key -T copy-mode-vi NPage send-keys -X page-down # Same for the mouse scroll button bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down # Toggle prefix on/off with F12 (for nested remote sessions) 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 # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) if "test ! -d ~/.tmux/plugins/tpm" \ "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" run '~/.tmux/plugins/tpm/tpm' # vim: se ft=tmux :