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.

156 lines
5.7 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. # List of disabled plugins on some reasons
  19. #set -g @plugin 'thewtex/tmux-mem-cpu-load'
  20. #set -g @plugin 'b0o/tmux-autoreload'
  21. #set -g @plugin 'ofirgall/tmux-window-name'
  22. #set -g @plugin 'tmux-plugins/tmux-sidebar'
  23. #set -g @treemux-tree-nvim-init-file '~/.tmux/plugins/treemux/configs/treemux_init.lua'
  24. #set -g @plugin 'kiyoon/treemux'
  25. #set -g @plugin 'leighmcculloch/tmux-colours-superhero'
  26. #run-shell "powerline-daemon -q"
  27. #source "/usr/share/powerline/bindings/tmux/powerline.conf"
  28. ## Plugin configuration
  29. set -g @continuum-restore 'on'
  30. set -g @continuum-save-interval '5'
  31. set -g @resurrect-capture-pane-contents 'on'
  32. set -g @yank_selection 'primary'
  33. set -g @man-size '40%'
  34. set -g @man-orientation 'h'
  35. set -g @man-shell-interactive 'off'
  36. #set-option -g @tmux-autoreload-entrypoints '~/.tmux.conf'
  37. #set -g @tmux-autoreload-quiet 1
  38. #set -g @sidebar-tree-position 'right'
  39. # True colors (via: https://jdhao.github.io/2018/10/19/tmux_nvim_true_color/ )
  40. set -g default-terminal "screen-256color"
  41. # tell Tmux that outside terminal supports true color
  42. set -ag terminal-overrides ",alacritty:RGB"
  43. # --- START colours superhero ---
  44. # not suppoerted option
  45. #setw -g utf8 on
  46. # Update Interval
  47. set -g status-interval 1
  48. # Status bar
  49. # not suppoerted option
  50. #set -g status-utf8 on
  51. set -g status-bg default
  52. set -g status-fg white
  53. # Status bar - left side
  54. set -g status-left ''
  55. # Status bar - right side
  56. set -g status-right-length 100
  57. set -g status-right-fg black
  58. set -g status-right-attr bold
  59. wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
  60. set -g status-right "$wg_is_keys_off #{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 "
  61. # Window status - not the current window
  62. set-window-option -g window-status-bg default
  63. set-window-option -g window-status-fg white
  64. set-window-option -g window-status-attr none
  65. set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  66. # Window status - current window
  67. set-window-option -g window-status-current-attr none
  68. 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]'
  69. # Pane borders
  70. set -g pane-border-bg default
  71. set -g pane-border-fg colour235
  72. set -g pane-active-border-bg default
  73. set -g pane-active-border-fg colour214
  74. # Pane number display
  75. set-option -g display-panes-active-colour colour214
  76. set-option -g display-panes-colour colour240
  77. # --- END colours superhero ---
  78. ## Windows style
  79. #set-option -g status-style fg=yellow,bg=default
  80. #set-window-option -g pane-active-border-style ''
  81. ## A bit more space in right status bar
  82. #set -g status-right-length 50
  83. ## Windows status style
  84. #set -g status-style "bg=#4c566a,fg=#eceff4"
  85. #set -g status-left "#[fg=#bf616a,bg=#ebcb8b,bold] #S "
  86. #set -g status-right "#{prefix_highlight} #[bg=#a3be8c,fg=black,bold] #U #[bg=#ebcb8b,fg=#bf616a,bold] #h "
  87. #setw -g window-status-format "#[fg=#81a1c1,bg=#4c566a] #I:#W "
  88. #setw -g window-status-current-format "#[fg=#2e3440,bg=#81a1c1,bold] #I:#W "
  89. #setw -g window-status-separator ""
  90. ## Rename windows to fit current application
  91. #setw -g automatic-rename on
  92. # Use zsh regardless of default settings
  93. if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
  94. # switch panes using Alt-arrow without prefix
  95. bind -n M-Left select-pane -L
  96. bind -n M-Right select-pane -R
  97. bind -n M-Up select-pane -U
  98. bind -n M-Down select-pane -D
  99. ## Mouse On by default
  100. set -g mouse on
  101. # PageUp/PageDown works for scrolling
  102. bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
  103. bind-key -T copy-mode-vi PPage send-keys -X page-up
  104. bind-key -T copy-mode-vi NPage send-keys -X page-down
  105. # Same for the mouse scroll button
  106. bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
  107. bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
  108. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  109. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  110. # Tmux config reload
  111. bind r source-file ~/.tmux.conf
  112. # Toggle prefix on/off with F12 (for nested remote sessions)
  113. bind -T root F12 \
  114. set prefix None \;\
  115. set key-table off \;\
  116. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  117. refresh-client -S \;\
  118. bind -T off F12 \
  119. set -u prefix \;\
  120. set -u key-table \;\
  121. refresh-client -S
  122. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  123. if "test ! -d ~/.tmux/plugins/tpm" \
  124. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  125. run '~/.tmux/plugins/tpm/tpm'
  126. # vim: se ft=tmux :