tmux.conf 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Use C-a instead of C-b as the prefix
  2. set -g prefix C-a
  3. unbind-key C-b
  4. bind-key C-a send-prefix
  5. # allow terminal scrolling
  6. set-option -g terminal-overrides 'urxvt*:smcup@:rmcup@'
  7. # set 256 colors
  8. set-option -g default-terminal "screen-256color"
  9. set-option -g display-time 2000
  10. # be more responsive, changing the default delay
  11. set-option -sg escape-time 1
  12. # set scrollback
  13. set-option -g history-limit 10000
  14. # Start numbering at 1
  15. set-option -g base-index 1
  16. set-window-option -g pane-base-index 1
  17. # force a reload of the config file
  18. unbind r
  19. bind r source-file ~/.tmux.conf \; display "Reloaded!"
  20. ## Copy mode
  21. # Copy selection to clipboard
  22. unbind-key -T copy-mode M-w
  23. bind-key -T copy-mode M-w send -X copy-pipe-and-cancel "xsel -ib"
  24. #Make Home & End keys work in copy mode
  25. bind-key -T copy-mode Home send -X start-of-line
  26. bind-key -T copy-mode End send -X end-of-line
  27. # Paste from clipboard
  28. unbind-key M-y
  29. bind-key -n M-y run "tmux set-buffer \"$(xsel -ob)\"; tmux paste-buffer"
  30. # Home/End keys
  31. bind -n Home send-keys C-a
  32. bind -n End send-keys C-e
  33. # Terminal title
  34. set-option -g set-titles on
  35. set-option -g set-titles-string '[#S:#I] #W'
  36. set-window-option -g automatic-rename on
  37. # aggresive resize
  38. set-window-option -g aggressive-resize on
  39. # Saner splitting.
  40. bind v split-window -h
  41. bind h split-window -v
  42. bind S choose-session
  43. # Pane resizing
  44. bind -r H resize-pane -L 5
  45. bind -r J resize-pane -D 5
  46. bind -r K resize-pane -U 5
  47. bind -r L resize-pane -R 5
  48. # Mode
  49. set-option -g mode-style bg=brightblack
  50. #Status bar
  51. set-option -g status off
  52. set-hook -g window-linked "if-shell -F '#{!=:#{session_windows},1}' 'set status on'"
  53. set-hook -g window-unlinked "if-shell -F '#{==:#{session_windows},1}' 'set status off'"
  54. # Status update interval
  55. set-option -g status-interval 2
  56. set -g status-justify right
  57. set -g status-bg default
  58. set -g status-fg default
  59. set -g status-interval 5
  60. # Window list
  61. setw -g window-status-format '#[fg=black,bold]#I:#W'
  62. setw -g window-status-current-format '#[fg=white]#I:#W'
  63. # Left
  64. set -g status-left '#[fg=black,bold]#(whoami)@#H #[fg=blue]>>#[fg=white,bold] #T'
  65. set -g status-left-length 60
  66. # Right
  67. set -g status-right ''
  68. # Pane border
  69. set-option -g pane-border-style bg=default
  70. set-option -g pane-border-style fg=brightblack
  71. set-option -g pane-active-border-style bg=default
  72. set-option -g pane-active-border-style fg=white
  73. # Pane number indicator
  74. set-option -g display-panes-colour brightblack
  75. set-option -g display-panes-active-colour brightwhite
  76. # Clock mode
  77. set-option -g clock-mode-colour white
  78. set-option -g clock-mode-style 24
  79. # Message
  80. set-option -g message-style bg=default
  81. set-option -g message-style fg=default
  82. # Activity
  83. set-window-option -g monitor-activity on
  84. set-option -g visual-activity on
  85. # Mouse stuff
  86. setw -g mouse on
  87. # Log output to a text file on demand
  88. bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
  89. # move between panes
  90. bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
  91. bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
  92. bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
  93. bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"