tmux.conf 3.1 KB

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