tmux.conf 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. ##### My (demuredemeanor) tmux config, a work in progress
  2. # Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
  3. # https://notabug.org/demure/dotfiles/
  4. # legacy repo http://github.com/demure/dotfiles
  5. #
  6. # Note to self: set=set-option; setw=set-window-option; setenv=set-environment;
  7. ### Main Settings ### {{{
  8. ## Fix glitch with underlined text in Terminal.app and hanging Prompt (iOS)
  9. ## From https://github.com/terlar/dotfiles/blob/master/tmux.conf
  10. ## Assume http://sourceforge.net/mailarchive/message.php?msg_id=30825085 is origin
  11. set -ag terminal-overrides ",*:XT@"
  12. new-session # tmux attach makes new, if not running
  13. set -ga update-environment 'DISPLAY' # Maybe fix DISPLAY?
  14. set -g base-index 1 # Window numbering starts at 1
  15. set -g pane-base-index 1 # Pane numbering starts at 1
  16. setw -g automatic-rename on # Auto set window title
  17. setw -g aggressive-resize on # Aggressive windows: For screen size, of diff connections, on diff windows
  18. set -g default-terminal "screen-256color"
  19. set -g history-limit 10000 # Scroll back history
  20. set -g display-panes-time 4000 # Increase show pane time
  21. set -g renumber-windows on # Make windows auto renumber
  22. ### End Main Settings ### }}}
  23. ### Key Bindings ### {{{
  24. unbind C-z # Unbind C-z so I don't suspend, and free for bind
  25. unbind C-b # Unbind C-b, so I can make C-z the prefix
  26. set -g prefix C-z # Change prefix key to C-z
  27. bind-key C-z last-window # Make <prefix>C-z go to last window
  28. unbind C-a
  29. bind-key C-a send-prefix # Make <prefix>C-a send C-z literally
  30. ## Join windows: <prefix> s, <prefix> j
  31. bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
  32. bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
  33. ## URL grab: <prefix> u
  34. bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
  35. ## Reload tmux.conf: <prefix> R
  36. bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
  37. ## Zoom: <prefix> Z # Needs tmux 1.8
  38. #bind Z resize-pane -Z
  39. ### Better Bindings for Splitting ### {{{
  40. unbind %
  41. # bind | split-window -h
  42. bind h split-window -h
  43. unbind '"'
  44. # bind - split-window -v
  45. bind v split-window -v
  46. ### End Splitting Bindings ### }}}
  47. ### Mouse On/Off ### {{{
  48. ## Mouse On by default
  49. set -g mode-mouse on
  50. set -g mouse-resize-pane on
  51. set -g mouse-select-pane on
  52. set -g mouse-select-window on
  53. ##Toggle mouse on with <prefix>m
  54. bind m \
  55. set -g mode-mouse on \;\
  56. set -g mouse-resize-pane on \;\
  57. set -g mouse-select-pane on \;\
  58. set -g mouse-select-window on \;\
  59. display 'Mouse: ON'
  60. ## Toggle mouse off with <prefix>M
  61. bind M \
  62. set -g mode-mouse off \;\
  63. set -g mouse-resize-pane off \;\
  64. set -g mouse-select-pane off \;\
  65. set -g mouse-select-window off \;\
  66. display 'Mouse: OFF'
  67. ### End Mouse On/Off ### }}}
  68. ### vi Mode for Scroll Back ### {{{
  69. setw -g mode-keys vi
  70. unbind [
  71. bind Escape copy-mode
  72. unbind p
  73. bind p paste-buffer
  74. bind-key -t vi-copy 'v' begin-selection
  75. bind-key -t vi-copy 'y' copy-selection
  76. bind-key -t vi-copy Escape cancel
  77. bind-key -t vi-copy 'Y' copy-end-of-line
  78. bind-key -t vi-copy 'V' select-line
  79. ### End vi Mode ### }}}
  80. ### Move Window Numbers ### {{{
  81. ## <prefix> Shift left/right
  82. # Inspired by https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
  83. bind-key S-Left swap-window -t -1
  84. bind-key S-Right swap-window -t +1
  85. ### End Window Numbers ### }}}
  86. ### End Key Bindings ### }}}
  87. ### Theming Settings ### {{{
  88. ## Terminal emulator window title
  89. set -g set-titles on
  90. set -g set-titles-string '#S:#I.#P #W'
  91. ## Notifying if other windows has activities
  92. setw -g monitor-activity on
  93. set -g visual-activity on
  94. ## Clock
  95. setw -g clock-mode-colour green
  96. setw -g clock-mode-style 24
  97. ## Inactive windows
  98. setw -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
  99. ### Status Bar ### {{{
  100. set -g status-bg black
  101. set -g status-fg white
  102. set -g status-interval 1
  103. set -g status-left '#[fg=green]#H#[default]'
  104. # set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
  105. set -g status-right '#[fg=cyan,bold]%Y-%m-%d %H:%M#[default]'
  106. ### Bar Bell ### {{{
  107. #setw -g window-status-bell-attr attributes
  108. #setw -g window-status-bell-bg colour
  109. #setw -g window-status-bell-fg colour
  110. ### End Bell ### }}}
  111. ### Bar Content ### {{{
  112. #setw -g window-status-content-attr attributes
  113. #setw -g window-status-content-bg colour
  114. #setw -g window-status-content-fg colour
  115. ### End Content ### }}}
  116. ### Bar Activity ### {{{
  117. #setw -g window-status-activity-attr attributes
  118. #setw -g window-status-activity-bg colour
  119. #setw -g window-status-activity-fg colour
  120. ### End Activity ### }}}
  121. ### Bar Current ### {{{
  122. ## Highlighting the active window in status bar
  123. #setw -g window-status-current-bg blue
  124. setw -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
  125. ### End Current ### }}}
  126. ### Bar Last ### {{{
  127. #setw -g window-status-last-attr attributes
  128. #setw -g window-status-last-bg color
  129. #setw -g window-status-last-fg color
  130. ### End Last ### }}}
  131. ### End Status Bar ### }}}
  132. ### Message/Message Command ### {{{
  133. set -g message-attr bright
  134. set -g message-bg cyan
  135. set -g message-fg white
  136. set -g message-command-attr bright
  137. set -g message-command-bg cyan
  138. set -g message-command-fg white
  139. ### End Message ### }}}
  140. ### Pane Colors ### {{{
  141. set -g pane-border-fg cyan
  142. set -g pane-active-border-fg cyan
  143. ### End Pane Colors ### }}}
  144. ### End Theming Settings ### }}}
  145. ### Need to Figure Out ### {{{
  146. ## Log pane to file
  147. #bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
  148. ## can has fit pbcopy on mac, and more??
  149. #set -g default-command "reattach-to-user-namespace -l zsh"
  150. ## Not usable??
  151. # Alerted window in status bar. Windows which have an alert (bell, activity or content).
  152. # set-window-option -g window-status-alert-fg red
  153. # set-window-option -g window-status-alert-bg white
  154. # ### Powerline ### {{{
  155. # ### Deconflict ### {{{
  156. # set -g status on
  157. # set -g status-interval 2
  158. # set -g status-utf8 on
  159. # set -g status-justify "centre"
  160. # #set -g status-left-length 60
  161. # #set -g status-right-length 90
  162. # set -g status-left "#(~/git/tmux-powerline/status-left.sh)"
  163. # set -g status-right "#(~/git/tmux-powerline/status-right.sh)"
  164. # ### End Deconflict ### }}}
  165. # set -g status-left-length 52
  166. # set -g status-right-length 451
  167. # set -g status-fg white
  168. # set -g status-bg colour234
  169. # set -g window-status-activity-attr bold
  170. # set -g pane-border-fg colour245
  171. # set -g pane-active-border-fg colour39
  172. # set -g message-fg colour16
  173. # set -g message-bg colour221
  174. # set -g message-attr bold
  175. # set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
  176. # set -g window-status-format "#[fg=white,bg=colour234] #I #W "
  177. # set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
  178. # ### End Powerline ### }}}
  179. ### End Figure Out ### }}}