shosei

tmux.conf

Mar 24th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.26 KB | None | 0 0
  1. # basic window operations
  2. unbind c
  3. bind c new-window
  4. unbind & # purposefully diffcult combination, better the shell's "C-d", or kill-pane
  5. bind & confirm-before kill-window
  6. unbind x # close pane (if last also the window)
  7. bind x confirm-before kill-pane
  8.  
  9. # window cycling "<" or "," for previous window
  10. unbind ,
  11. bind -r , previous-window
  12. unbind <
  13. bind -r < previous-window
  14. unbind Left
  15. bind -r Left previous-window
  16.  
  17. # ">" or "." for next window
  18. unbind .
  19. bind -r . next-window
  20. unbind >
  21. bind -r > next-window
  22. unbind Right
  23. bind -r Right next-window
  24.  
  25. # find a window by name
  26. unbind f
  27. bind f command-prompt "find-window '%%'"
  28.  
  29. # rename a window (gnuscreen default shortcut)
  30. unbind A
  31. bind A command-prompt "rename-window %%"
  32.  
  33. # backspace for last active window
  34. unbind Tab
  35. bind -r Tab last-window
  36.  
  37. # window picker
  38. unbind w
  39. bind w choose-window
  40.  
  41.  
  42. # add split side-by-side
  43. unbind |
  44. bind -r | split-window -h
  45.  
  46. # add split top-bottom
  47. unbind _
  48. bind -r _ split-window -v
  49.  
  50. # swap panes
  51. unbind {
  52. bind -r { swap-pane -U
  53. unbind }
  54. bind -r } swap-pane -D
  55.  
  56. # number panes visibly
  57. unbind q
  58. bind q display-panes
  59.  
  60. # cycle through pane layouts
  61. unbind Space
  62. bind -r Space next-layout
  63.  
  64. # change pane focus (like vi cursor movement)
  65. unbind k
  66. bind -r k select-pane -U
  67. unbind j
  68. bind -r j select-pane -D
  69. unbind h
  70. bind -r h select-pane -L
  71. unbind l
  72. bind -r l select-pane -R
  73.  
  74. # resize pane
  75. unbind '('
  76. bind -r '(' resize-pane -L 4
  77. unbind ')'
  78. bind -r ')' resize-pane -R 4
  79. unbind +
  80. bind -r + resize-pane -U 2
  81. unbind -
  82. bind -r - resize-pane -D 2
  83.  
  84.  
  85. # command line
  86. unbind :
  87. bind : command-prompt
  88.  
  89.  
  90. # display key bindings
  91. unbind ?
  92. bind ? list-keys
  93.  
  94.  
  95. # copy and scroll mode (see "man tmux"), and paste
  96. unbind [
  97. bind [ copy-mode
  98. unbind ]
  99. bind -r ] paste-buffer -s \015 # sadly '-r' doesnt work here, hopefully one day it does
  100. unbind PPage
  101. bind PPage copy-mode -u # to copymode and one page up (pgup/dn passed on)
  102.  
  103. # additional keys to use in copy (scroll) mode
  104. bind -t emacs-copy Enter copy-selection
  105. bind -t emacs-copy Space begin-selection
  106.  
  107. # apply the config file again...
  108. unbind r
  109. bind r source-file /etc/tmux.conf
  110.  
  111. # page up and down
  112. # --> this has to be done for the shell, vi aparently works well.
  113.  
  114. # TODO:
  115. # * keybindings for detaching/attaching
  116. # * for session/client/buffer management
  117. # * for buffer filling and pasting
  118. # * mouse scroll fix
  119. # * mouse click focus
  120. # * alt-tab style feature request
  121. # * select+move splitters (need splitter highlighting)
  122. # * quake style "toggle terminal from above", bound to "~"
  123.  
  124.  
  125. # its not logic to have the most left 'tab' on the very right of the key strip
  126. set -g base-index 1
  127.  
  128. # should fix scrolling issues (with shift pgup/dn)
  129. set -g terminal-overrides 'xterm*:smcup@:rmcup@'
  130.  
  131. # some general config options
  132. set -g default-terminal "screen-256color"
  133. set -g history-limit 10000
  134. set -g repeat-time 800
  135.  
  136. set -g status on
  137. set -g status-keys emacs
  138.  
  139. set -g bell-action any
  140. set -g visual-bell on
  141. setw -g monitor-activity on # monitor activity of all windows
  142. setw -g monitor-content on # monitor for content changes as well
  143. set -g visual-activity off # no flashy messages in my status line please! (watch the window attrs '#-*!+' instead)
  144. set -g visual-content off # idem
  145. setw -g mode-keys emacs
  146. setw -g mode-mouse off # on prevents mouse select on the terminal
  147. set -g mouse-select-pane off # on prevents mouse select in panes
  148. setw -g utf8 on
  149.  
  150. # window title
  151. set -g set-titles on
  152. setw -g automatic-rename on
  153.  
  154. # status bar
  155. set -g status-utf8 on
  156. set -g status-justify centre
  157. set -g status-interval 5
  158. set -g status-left-length 30
  159. set -g status-left ''
  160. set -g status-right '#[fg=blue,bold]#H#[default] #[fg=green]» #[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg) #[fg=green]» #[fg=cyan]#S#[default] #[fg=green]» #[fg=red]#(acpi | cut -d "," -f 2 | sed "s/^ *//g") #[fg=green]» #[fg=magenta]%R#[default]'
  161. set -g status-right-length 45
  162.  
  163. # colors
  164. set -g message-bg default
  165. set -g message-fg green
  166. set -g status-bg default
  167. set -g status-fg green
  168. setw -g window-status-bg default
  169. setw -g window-status-fg green
  170. setw -g window-status-alert-attr none
  171. setw -g window-status-alert-bg default
  172. setw -g window-status-alert-fg green
  173. setw -g window-status-current-bg red
  174. setw -g window-status-current-fg black
Advertisement
Add Comment
Please, Sign In to add comment