tmux.conf 2.8 KB

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