You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.1 KiB

  1. set -g @plugin 'tmux-plugins/tpm'
  2. set -g @plugin 'tmux-plugins/tmux-sensible'
  3. set -g @plugin 'tmux-plugins/tmux-resurrect'
  4. set -g @plugin 'tmux-plugins/tmux-continuum'
  5. set -g @plugin 'tmux-plugins/tmux-pain-control'
  6. set -g @plugin 'tmux-plugins/tmux-yank'
  7. set -g @plugin 'tmux-plugins/tmux-sessionist'
  8. ## Plugin configuration
  9. set -g @continuum-restore 'on'
  10. set -g @continuum-save-interval '5'
  11. set -g @resurrect-capture-pane-contents 'on'
  12. set -g @yank_selection 'primary'
  13. set -g @man-size '40%'
  14. set -g @man-orientation 'h'
  15. set -g @man-shell-interactive 'off'
  16. set -g default-terminal "screen-256color"
  17. set -ag terminal-overrides ",alacritty:RGB"
  18. # switch panes using Alt-arrow without prefix
  19. bind -n M-Left select-pane -L
  20. bind -n M-Right select-pane -R
  21. bind -n M-Up select-pane -U
  22. bind -n M-Down select-pane -D
  23. ## Mouse On by default
  24. set -g mouse on
  25. # PageUp/PageDown works for scrolling
  26. bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
  27. bind-key -T copy-mode-vi PPage send-keys -X page-up
  28. bind-key -T copy-mode-vi NPage send-keys -X page-down
  29. # Same for the mouse scroll button
  30. bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
  31. bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
  32. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  33. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  34. # Tmux config reload
  35. bind r source-file ~/.tmux.conf
  36. # Toggle prefix on/off with F12 (for nested remote sessions)
  37. bind -T root F12 \
  38. set prefix None \;\
  39. set key-table off \;\
  40. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  41. refresh-client -S \;\
  42. bind -T off F12 \
  43. set -u prefix \;\
  44. set -u key-table \;\
  45. refresh-client -S
  46. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  47. if "test ! -d ~/.tmux/plugins/tpm" \
  48. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  49. run '~/.tmux/plugins/tpm/tpm'