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.

89 lines
3.0 KiB

  1. ## Prefix like in screen
  2. set -g prefix 'C-a'
  3. ## Use xterm keys (makes eg. Ctrl+Arrow navigate words)
  4. set-window-option -g xterm-keys on
  5. ## List of plugins
  6. # For this to work you need to install https://github.com/tmux-plugins/tpm
  7. set -g @plugin 'tmux-plugins/tpm'
  8. set -g @plugin 'tmux-plugins/tmux-sensible'
  9. # Those two allow continuous saving and restoring of tmux sessions
  10. set -g @plugin 'tmux-plugins/tmux-resurrect'
  11. set -g @plugin 'tmux-plugins/tmux-continuum'
  12. # Intuitive bindings for splitting panes
  13. set -g @plugin 'tmux-plugins/tmux-pain-control'
  14. # Integrations with system clipboard
  15. set -g @plugin 'tmux-plugins/tmux-yank'
  16. # Easier session management
  17. set -g @plugin 'tmux-plugins/tmux-sessionist'
  18. # Man in a split
  19. set -g @plugin 'knakayama/tmux-man'
  20. # Peek-a-boo
  21. set -g @plugin 'knakayama/tmux-newline-detector'
  22. ## Plugin configuration
  23. set -g @continuum-restore 'on'
  24. set -g @continuum-save-interval '5'
  25. set -g @resurrect-capture-pane-contents 'on'
  26. set -g @yank_selection 'primary'
  27. set -g @man-size '40%'
  28. set -g @man-orientation 'h'
  29. set -g @man-shell-interactive 'off'
  30. # True colors (via: https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ )
  31. set -g default-terminal "screen-256color"
  32. # tell Tmux that outside terminal supports true color
  33. set -ag terminal-overrides ",alacritty:RGB"
  34. ## Windows style
  35. set-option -g status-style fg=yellow,bg=default
  36. set-window-option -g pane-active-border-style ''
  37. ## A bit more space in right status bar
  38. set -g status-right-length 50
  39. ## Rename windows to fit current application
  40. setw -g automatic-rename on
  41. # Use zsh regardless of default settings
  42. if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
  43. # switch panes using Alt-arrow without prefix
  44. bind -n M-Left select-pane -L
  45. bind -n M-Right select-pane -R
  46. bind -n M-Up select-pane -U
  47. bind -n M-Down select-pane -D
  48. ## Mouse On by default
  49. set -g mouse on
  50. # PageUp/PageDown works for scrolling
  51. bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
  52. bind-key -T copy-mode-vi PPage send-keys -X page-up
  53. bind-key -T copy-mode-vi NPage send-keys -X page-down
  54. # Same for the mouse scroll button
  55. bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
  56. bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
  57. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  58. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  59. # Toggle prefix on/off with F12 (for nested remote sessions)
  60. bind -T root F12 \
  61. set prefix None \;\
  62. set key-table off \;\
  63. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  64. refresh-client -S \;\
  65. bind -T off F12 \
  66. set -u prefix \;\
  67. set -u key-table \;\
  68. refresh-client -S
  69. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  70. if "test ! -d ~/.tmux/plugins/tpm" \
  71. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  72. run '~/.tmux/plugins/tpm/tpm'
  73. # vim: se ft=tmux :