My personal dotfiles
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.

.tmux.conf 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ##
  2. ## O P T I O N S
  3. ##
  4. set-option -g default-shell /bin/zsh
  5. # Vim keys
  6. set-window-option -g mode-keys vi
  7. # Start numbering at 1
  8. set -g base-index 1
  9. # Allows for faster key repetition
  10. set -s escape-time 0
  11. # Rather than constraining window size to the maximum size of any client
  12. # connected to the *session*, constrain window size to the maximum size of any
  13. # client connected to *that window*. Much more reasonable.
  14. setw -g aggressive-resize on
  15. # Activity monitoring
  16. setw -g monitor-activity on
  17. set -g visual-activity on
  18. # set to main-horizontal, 60% height for main pane
  19. bind m set-window-option main-pane-height 60\; select-layout main-horizontal
  20. # auto window rename
  21. set-window-option -g automatic-rename
  22. ##
  23. ## B I N D I N G S
  24. ##
  25. # C-b is not acceptable -- Vim uses it
  26. #unbind C-b
  27. set-option -g prefix C-a
  28. bind-key C-a last-window
  29. # set window split
  30. bind-key v split-window -h
  31. bind-key b split-window
  32. # Allows us to use C-a a <command> to send commands to a TMUX session inside
  33. # another TMUX session
  34. bind-key a send-prefix
  35. # Vi copypaste mode
  36. bind-key -t vi-copy 'v' begin-selection
  37. bind-key -t vi-copy 'y' copy-selection
  38. # Use Alt-vim keys without prefix key to switch panes
  39. bind -n M-h select-pane -L
  40. bind -n M-j select-pane -D
  41. bind -n M-k select-pane -U
  42. bind -n M-l select-pane -R
  43. # reload config
  44. bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
  45. bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
  46. ##
  47. ## C O L O R S
  48. ##
  49. set -g default-terminal "screen-256color"
  50. set-option -g status-bg colour235 #base02
  51. set-option -g status-fg colour136 #yellow
  52. set-option -g status-attr default
  53. # default window title colors
  54. set-window-option -g window-status-fg colour244 #base0
  55. set-window-option -g window-status-bg default
  56. # active window title colors
  57. set-window-option -g window-status-current-fg colour166 #orange
  58. set-window-option -g window-status-current-bg default
  59. #set-window-option -g window-status-current-attr bright
  60. # pane border
  61. set-option -g pane-border-fg colour235 #base02
  62. set-option -g pane-active-border-fg colour240 #base01
  63. # message text
  64. set-option -g message-bg colour235 #base02
  65. set-option -g message-fg colour166 #orange
  66. # pane number display
  67. set-option -g display-panes-active-colour colour33 #blue
  68. set-option -g display-panes-colour colour166 #orange
  69. # clock
  70. set-window-option -g clock-mode-colour green #green
  71. # status
  72. set -g status-interval 1
  73. set -g status-justify centre # center align window list
  74. set -g status-left-length 20
  75. set -g status-right-length 140
  76. set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
  77. set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
  78. # from powerline
  79. run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
  80. run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
  81. # status bar
  82. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on'
  83. # rm mouse mode fail
  84. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\)' 'set -g mouse off'
  85. if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off'
  86. # fix pane_current_path on new window and splits
  87. if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind c; bind c new-window -c "#{pane_current_path}"'
  88. if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
  89. if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
  90. if-shell "test '#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)'" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'