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.

155 lines
5.5 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. 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 '
  60. # Window status - not the current window
  61. set-window-option -g window-status-bg default
  62. set-window-option -g window-status-fg white
  63. set-window-option -g window-status-attr none
  64. set-window-option -g window-status-format '#[fg=colour214,bg=colour235] #I #[fg=white,bg=colour236] #(pwd="#{pane_current_path}"; echo ${pwd####*/}) #W #[default]'
  65. # Window status - current window
  66. set-window-option -g window-status-current-attr none
  67. 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]'
  68. # Pane borders
  69. set -g pane-border-bg default
  70. set -g pane-border-fg colour235
  71. set -g pane-active-border-bg default
  72. set -g pane-active-border-fg colour214
  73. # Pane number display
  74. set-option -g display-panes-active-colour colour214
  75. set-option -g display-panes-colour colour240
  76. # --- END colours superhero ---
  77. ## Windows style
  78. #set-option -g status-style fg=yellow,bg=default
  79. #set-window-option -g pane-active-border-style ''
  80. ## A bit more space in right status bar
  81. #set -g status-right-length 50
  82. ## Windows status style
  83. #set -g status-style "bg=#4c566a,fg=#eceff4"
  84. #set -g status-left "#[fg=#bf616a,bg=#ebcb8b,bold] #S "
  85. #set -g status-right "#{prefix_highlight} #[bg=#a3be8c,fg=black,bold] #U #[bg=#ebcb8b,fg=#bf616a,bold] #h "
  86. #setw -g window-status-format "#[fg=#81a1c1,bg=#4c566a] #I:#W "
  87. #setw -g window-status-current-format "#[fg=#2e3440,bg=#81a1c1,bold] #I:#W "
  88. #setw -g window-status-separator ""
  89. ## Rename windows to fit current application
  90. #setw -g automatic-rename on
  91. # Use zsh regardless of default settings
  92. if-shell 'test -x /usr/bin/zsh' 'set-option -g default-shell /usr/bin/zsh'
  93. # switch panes using Alt-arrow without prefix
  94. bind -n M-Left select-pane -L
  95. bind -n M-Right select-pane -R
  96. bind -n M-Up select-pane -U
  97. bind -n M-Down select-pane -D
  98. ## Mouse On by default
  99. set -g mouse on
  100. # PageUp/PageDown works for scrolling
  101. bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
  102. bind-key -T copy-mode-vi PPage send-keys -X page-up
  103. bind-key -T copy-mode-vi NPage send-keys -X page-down
  104. # Same for the mouse scroll button
  105. bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
  106. bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
  107. bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
  108. bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
  109. # Tmux config reload
  110. bind r source-file ~/.tmux.conf
  111. # Toggle prefix on/off with F12 (for nested remote sessions)
  112. bind -T root F12 \
  113. set prefix None \;\
  114. set key-table off \;\
  115. if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
  116. refresh-client -S \;\
  117. bind -T off F12 \
  118. set -u prefix \;\
  119. set -u key-table \;\
  120. refresh-client -S
  121. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  122. if "test ! -d ~/.tmux/plugins/tpm" \
  123. "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  124. run '~/.tmux/plugins/tpm/tpm'
  125. # vim: se ft=tmux :