tmux.conf 3.9 KB

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