tmux.conf 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Use `Ctrl-A` as the tmux command prefix instead of `Ctrl-B`.
  2. unbind-key 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-option -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-key % # Remove default binding for horizontal split since we’re replacing it.
  67. bind-key \ split-window -h
  68. bind-key - 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. # Colours and status line.
  77. source-file ~/dotfiles/tmux/tmuxcolours.conf