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.

122 lines
4.2 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. set -g @plugin 'tmux-plugins/tmux-resurrect'
  10. set -g @plugin 'tmux-plugins/tmux-continuum'
  11. set -g @plugin 'tmux-plugins/tmux-pain-control'
  12. set -g @plugin 'tmux-plugins/tmux-yank'
  13. set -g @plugin 'tmux-plugins/tmux-sessionist'
  14. set -g @plugin 'knakayama/tmux-man'
  15. set -g @plugin 'knakayama/tmux-newline-detector'
  16. set -g @plugin 'anghootys/tmux-ip-address'
  17. set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
  18. ## Plugin configuration
  19. set -g @continuum-restore 'on'
  20. set -g @continuum-save-interval '5'
  21. set -g @resurrect-capture-pane-contents 'on'
  22. set -g @resurrect-processes 'su'
  23. set -g @yank_selection 'primary'
  24. set -g @yank_selection_mouse 'clipboard'
  25. set -g @man-size '40%'
  26. set -g @man-orientation 'h'
  27. set -g @man-shell-interactive 'off'
  28. # Tmux system configuration
  29. set-option -gq display-time "2600"
  30. set -g default-terminal "xterm-256color"
  31. # --- START colours superhero ---
  32. # not suppoerted option
  33. #setw -g utf8 on
  34. # Update Interval
  35. set -g status-interval 1
  36. # Status bar
  37. # not suppoerted option
  38. #set -g status-utf8 on
  39. set -g status-bg black
  40. set -g status-fg white
  41. # Status bar - left side
  42. set -g status-left-length 50
  43. set -g status-left-fg white
  44. set -g status-right-attr bold
  45. set -g status-left-bg blue
  46. set -g status-left '#(if [ "#S" -ge 0 ]; then echo " "; else echo " #S "; fi)'
  47. # Status bar - right side
  48. set -g status-right-length 100
  49. set -g status-right-fg black
  50. set -g status-right-attr bold
  51. set -g status-right '#{prefix_highlight} #{?window_zoomed_flag,#[fg=colour178]ZOOMED #[fg=colour238]• ,}#[fg=colour178]#h #[fg=colour238]• #[fg=colour178]#{ip_address} #[fg=colour238]• #[fg=colour178]%a %b %d #[fg=colour178]%I:%M%P '
  52. # Window status - not the current window
  53. set-window-option -g window-status-bg default
  54. set-window-option -g window-status-fg white
  55. set-window-option -g window-status-attr none
  56. set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  57. # Window status - current window
  58. set-window-option -g window-status-current-attr none
  59. set-window-option -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  60. # Pane borders
  61. set -g pane-border-bg default
  62. set -g pane-border-fg colour235
  63. set -g pane-active-border-bg default
  64. set -g pane-active-border-fg colour214
  65. # Pane number display
  66. set-option -g display-panes-active-colour colour214
  67. set-option -g display-panes-colour colour240
  68. # --- END colours superhero ---
  69. # switch panes using Alt-arrow without prefix
  70. bind -n M-Left select-pane -L
  71. bind -n M-Right select-pane -R
  72. bind -n M-Up select-pane -U
  73. bind -n M-Down select-pane -D
  74. ## Mouse On by default
  75. set -g mouse on
  76. ## Scoll for vim
  77. bind -n WheelUpPane if "echo #{pane_current_command} | grep vim" "select-pane -t =; send-keys -N 4 Up" "select-pane -t =; copy-mode -e; send-keys -M"
  78. bind -n WheelDownPane if "echo #{pane_current_command} | grep vim" "select-pane -t =; send-keys -N 4 Down" "select-pane -t =; send-keys -M"
  79. # And additional scrolling things for tmux copy-mode
  80. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  81. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  82. # Tmux config reload
  83. bind r source-file ~/.tmux.conf
  84. # Toggle prefix on/off with F12 (for nested remote sessions)
  85. bind -T root F12 \
  86. set prefix None \;\
  87. set key-table off \;\
  88. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  89. refresh-client -S \;\
  90. bind -T off F12 \
  91. set -u prefix \;\
  92. set -u key-table \;\
  93. refresh-client -S
  94. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  95. if-shell "test ! -d ~/.tmux/plugins/tpm" \
  96. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'; run '~/.tmux/plugins/tpm/tpm'; run '~/.tmux/plugins/tpm/bin/install_plugins'; run '~/.tmux/plugins/tpm/tpm'" \
  97. "run '~/.tmux/plugins/tpm/tpm'"
  98. # vim: se ft=tmux :