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.

117 lines
4.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. 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-style fg=white,bold,bg=blue
  43. set -g status-left '#(if [ "#S" -ge 0 ]; then echo " "; else echo " #S "; fi)'
  44. # Status bar - right side
  45. set -g status-right-length 100
  46. set -g status-right-style fg=black,bold
  47. 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 '
  48. # Window status - not the current window
  49. set -g window-status-style bg=default,fg=white,none
  50. set -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  51. # Window status - current window
  52. set -g window-status-current-style none
  53. set -g window-status-current-format '#[fg=black,bg=colour214] #I #[fg=brightwhite,bg=colour238] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  54. # Pane borders
  55. set -g pane-border-style bg=default,fg=colour235
  56. set -g pane-active-border-style bg=default,fg=colour214
  57. # Pane number display
  58. set-option -g display-panes-active-colour colour214
  59. set-option -g display-panes-colour colour240
  60. # --- END colours superhero ---
  61. # Use zsh regardless of default settings
  62. if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
  63. # switch panes using Alt-arrow without prefix
  64. bind -n M-Left select-pane -L
  65. bind -n M-Right select-pane -R
  66. bind -n M-Up select-pane -U
  67. bind -n M-Down select-pane -D
  68. ## Mouse On by default
  69. set -g mouse on
  70. ## Scoll for vim
  71. 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"
  72. bind -n WheelDownPane if "echo #{pane_current_command} | grep vim" "select-pane -t =; send-keys -N 4 Down" "select-pane -t =; send-keys -M"
  73. # And additional scrolling things for tmux copy-mode
  74. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  75. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  76. # Tmux config reload
  77. bind r source-file ~/.tmux.conf
  78. # Toggle prefix on/off with F12 (for nested remote sessions)
  79. bind -T root F12 \
  80. set prefix None \;\
  81. set key-table off \;\
  82. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  83. refresh-client -S \;\
  84. bind -T off F12 \
  85. set -u prefix \;\
  86. set -u key-table \;\
  87. refresh-client -S
  88. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  89. if "test ! -d ~/.tmux/plugins/tpm" \
  90. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  91. run '~/.tmux/plugins/tpm/tpm'
  92. # vim: se ft=tmux :