tmux.conf 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # use Ctrl-A as the tmux command prefix instead of Ctrl-B
  2. unbind C-b
  3. set-option -g prefix C-a
  4. # start windows and panes from 1, not 0
  5. set-option -g base-index 1
  6. set-option -g pane-base-index 1
  7. # history scrollback
  8. set-option -g history-limit 9999999
  9. # Display a status line message when activity occurs in a window for which the
  10. # monitor-activity window option is enabled.
  11. set-option -g visual-activity on
  12. # Resize the window to the size of the smallest session for which it is the
  13. # current window, rather than the smallest session to which it is attached.
  14. set-window-option -g aggressive-resize on
  15. # Mouse Support! (for scrollback, and lazy manipulation of windows/panes)
  16. # At least with iTerm2, this plays very well with vim mouse support :D Yay!
  17. # Note: text-selection by default does a tmux copy (paste with prefix+]).
  18. # Hold alt/meta/option for system selection/copy.
  19. set-option -g mode-mouse on
  20. set-option -g mouse-select-pane
  21. set-option -g mouse-resize-pane on
  22. set-option -g mouse-select-window on
  23. # act like vim
  24. set-option -g status-keys vi
  25. set-window-option -g mode-keys vi # vi keys in copy mode (prefix+[)
  26. #######################
  27. # General Key Bindings
  28. #######################
  29. # act like vim. enhance copy mode to use more vim like keys for copying
  30. bind-key -t vi-copy 'v' begin-selection
  31. bind-key -t vi-copy 'y' copy-selection
  32. # prefix+R to reload the config file
  33. bind-key C-r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded";
  34. # detach client like screen, C-a C-d
  35. bind-key C-d detach-client
  36. ###################################
  37. # Window/Pane/Session Manipulation
  38. ###################################
  39. # Window Movement
  40. bind-key -r C-h previous-window
  41. bind-key -r C-l next-window
  42. bind-key C-a last-window
  43. bind-key -n M-1 select-window -t 1
  44. bind-key -n M-2 select-window -t 2
  45. bind-key -n M-3 select-window -t 3
  46. bind-key -n M-4 select-window -t 4
  47. bind-key -n M-5 select-window -t 5
  48. bind-key -n M-6 select-window -t 6
  49. bind-key -n M-7 select-window -t 7
  50. bind-key -n M-8 select-window -t 8
  51. bind-key -n M-9 select-window -t 9
  52. bind-key -n M-0 select-window -t 10
  53. # Window Creation/Destruction
  54. bind-key C-c new-window
  55. # Remember `prefix+,` for renaming windows
  56. # Pane Movement
  57. bind-key h select-pane -L
  58. bind-key j select-pane -D
  59. bind-key k select-pane -U
  60. bind-key l select-pane -R
  61. # Pane Creation/Destruction
  62. unbind % # Remove default binding for horizontal split since we’re replacing
  63. bind-key -n C-\ split-window -h
  64. bind-key -n C-_ split-window -v
  65. bind-key C-x kill-pane
  66. # Pane Sychronisation
  67. bind-key s set -w synchronize-panes
  68. # Session Switching/Destruction
  69. bind-key C-s choose-session
  70. bind-key X kill-session
  71. # Remember `prefix+$` for renaming sessions
  72. ########################
  73. # Visual
  74. ########################
  75. # Use solarized colour palette
  76. source ~/dotfiles/tmux/tmux-colors-solarized/tmuxcolors-256.conf
  77. # Use powerline plugin
  78. #source ~/dotfiles/powerline/powerline/powerline/bindings/tmux/powerline.conf
  79. # we'd rather roll our own not-so-blue-and-annoying color scheme
  80. # TODO work this into a powerline config in ~/.config/powerline
  81. set -g status on
  82. ##set -g status-position top
  83. set -g status-utf8 on
  84. set -g status-interval 2
  85. set -g status-justify "centre"
  86. set -g status-fg colour231
  87. set -g status-bg colour234
  88. set -g status-left-length 90
  89. set -g status-left '#[fg=colour189,bg=colour55] #S #[fg=colour55,bg=colour233]#(powerline tmux left)'
  90. set -g status-right-length 90
  91. set -g status-right '#(powerline tmux right) #(~/dotfiles/powerline/rainbarf/rainbarf --remaining --rgb --width 10)'
  92. set -g window-status-format " #[fg=colour244,bg=colour234]#I#F#[fg=colour249]#W "
  93. set -g window-status-current-format "#[fg=red,bg=red] #[fg=colour231,bg=red]#I #[fg=colour231,bold]#W#[fg=red,bg=red,nobold] "