tmux.conf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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)
  15. set-option -g mode-mouse on
  16. # act like vim
  17. set-option -g status-keys vi
  18. set-window-option -g mode-keys vi # vi keys in copy mode (prefix+[)
  19. #######################
  20. # General Key Bindings
  21. #######################
  22. # act like vim. enhance copy mode to use more vim like keys for copying
  23. bind-key -t vi-copy 'v' begin-selection
  24. bind-key -t vi-copy 'y' copy-selection
  25. # prefix+R to reload the config file
  26. bind-key C-r source-file ~/.tmux.conf; display-message "tmux.conf reloaded"
  27. # detach client like screen, C-a C-d
  28. bind-key C-d detach-client
  29. ###################################
  30. # Window/Pane/Session Manipulation
  31. ###################################
  32. # Window Movement
  33. bind-key -r C-h previous-window
  34. bind-key -r C-l next-window
  35. bind-key -n M-1 select-window -t 1
  36. bind-key -n M-2 select-window -t 2
  37. bind-key -n M-3 select-window -t 3
  38. bind-key -n M-4 select-window -t 4
  39. bind-key -n M-5 select-window -t 5
  40. bind-key -n M-6 select-window -t 6
  41. bind-key -n M-7 select-window -t 7
  42. bind-key -n M-8 select-window -t 8
  43. bind-key -n M-9 select-window -t 9
  44. bind-key -n M-0 select-window -t 10
  45. # Window Creation/Destruction
  46. bind-key C-c new-window
  47. # Remember `prefix+,` for renaming windows
  48. # Pane Movement
  49. bind-key h select-pane -L
  50. bind-key j select-pane -D
  51. bind-key k select-pane -U
  52. bind-key l select-pane -R
  53. # Pane Creation/Destruction
  54. unbind % # Remove default binding for horizontal split since we’re replacing
  55. bind-key -n C-\ split-window -h
  56. bind-key -n C-_ split-window -v
  57. bind-key C-x kill-pane
  58. # Pane Sychronisation
  59. bind-key s set -w synchronize-panes
  60. # Session Switching/Destruction
  61. bind-key C-s choose-session
  62. bind-key X kill-session
  63. # Remember `prefix+$` for renaming sessions
  64. ########################
  65. # Visual
  66. ########################
  67. # Use solarized colour palette
  68. source ~/dotfiles/tmux/tmux-colors-solarized/tmuxcolors-256.conf
  69. # tmux-powerline setup
  70. set-option -g status on
  71. set-option -g status-interval 2
  72. set-option -g status-utf8 on
  73. set-option -g status-justify "centre"
  74. set-option -g status-left-length 60
  75. set-option -g status-right-length 90
  76. set-option -g status-left "#(~/dotfiles/tmux/tmux-powerline-custom/status-left.sh)"
  77. set-option -g status-right "#(~/dotfiles/tmux/tmux-powerline-custom/status-right.sh)"