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.

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