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.

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