No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

161 líneas
5.3 KiB

  1. # Setup utf8 by default and vi mode
  2. set-window-option -g utf8 on
  3. set-window-option -g mode-keys vi
  4. set-window-option -g aggressive-resize on
  5. set-option -g default-command zsh
  6. set-option -g default-terminal 'xterm-256color'
  7. # Status line options, mainly coloring
  8. set-window-option -g window-status-bg colour6
  9. set-window-option -g window-status-fg black
  10. set-window-option -g window-status-current-bg white
  11. # Status line options
  12. set-option -g status-bg black
  13. set-option -g status-fg colour7
  14. set-option -g status-left-length 24
  15. set-option -g status-left ''
  16. set-option -g status-right-length 13
  17. set-option -g status-right "%a %H:%M:%S"
  18. set-option -g status-interval 7
  19. set-option -g status-utf8 on
  20. # Pane border options, mimics the status line coloring
  21. set-option -g pane-border-bg colour15
  22. set-option -g pane-border-fg colour82
  23. set-option -g pane-active-border-bg colour15
  24. set-option -g pane-active-border-fg colour2
  25. # Alert related things
  26. set-option -g visual-activity on
  27. set-option -g visual-bell on
  28. set-option -g message-bg colour7
  29. set-option -g message-fg black
  30. # Pass through the window title and display it automatically on changes.
  31. set-option -g set-titles on
  32. set-option -g set-titles-string '#T'
  33. set-window-option -g automatic-rename on
  34. # Key rebinding to make things more au naturalle
  35. bind-key R \
  36. source-file ~/.tmux.conf \;\
  37. display 'reloaded tmux config'
  38. # Log pane output to a file, save with an iso8601 datestamp
  39. bind-key o \
  40. pipe-pane -o "cat >> $HOME/tmux-`iso8601`.log" \;\
  41. set-window-option window-status-current-fg green \;
  42. bind-key O \
  43. pipe-pane \;\
  44. set-window-option window-status-current-fg default \;
  45. bind-key N new-session -t default
  46. # Using s for synchronizing panes, means that s for choosing sessions
  47. # is now e
  48. unbind-key s # interactive select sessions
  49. bind-key e choose-tree
  50. # (un)synchronize panes with prefix-s
  51. bind-key s \
  52. if-shell \
  53. "tmux show-window-options | grep 'synchronize-panes on'" \
  54. "set-window-option window-status-current-bg colour7; \
  55. set-window-option pane-active-border-fg colour2; \
  56. set-window-option pane-active-border-bg colour15; \
  57. set-window-option synchronize-panes off; \
  58. display 'synchronization off'" \
  59. "set-window-option window-status-current-bg red; \
  60. set-window-option pane-active-border-fg red; \
  61. set-window-option pane-active-border-bg colour15; \
  62. set-window-option synchronize-panes on; \
  63. display 'synchronizing'"
  64. # same thing as ^ so it sets up things if we were started with
  65. # something else that set synchronization.
  66. if-shell \
  67. "tmux show-window-options | grep 'synchronize-panes on' || /bin/true" \
  68. "set-window-option window-status-current-bg red; \
  69. set-window-option pane-active-border-fg yellow; \
  70. set-window-option pane-active-border-bg red"
  71. # Setup splits to be less annoying
  72. bind-key \ split-window -h
  73. bind-key - split-window -v
  74. # vi keybindings for pane navigation
  75. bind-key k select-pane -U
  76. bind-key j select-pane -D
  77. bind-key h select-pane -L
  78. bind-key l select-pane -R
  79. # Make it so that I can detach/etc while holding control down,
  80. # PURE LAZY
  81. bind-key C-d detach
  82. bind-key C-n next-window
  83. bind-key C-p previous-window
  84. bind-key C-k select-pane -U
  85. bind-key C-j select-pane -D
  86. bind-key C-h select-pane -L
  87. bind-key C-l select-pane -R
  88. # Non confirming kill pane plskthxbai
  89. bind-key x kill-pane
  90. # In case something I run exits straight away, i'd like to know about it.
  91. set-option -g set-remain-on-exit on
  92. # Lets change the prefix key so we don't clobber emacs back one char key
  93. unbind-key C-b
  94. # hacky, but C-\ isn't used by anything overly important in emacs
  95. set-option -g prefix 'C-\'
  96. # two C-\'s == C-\, if i need it, likely not
  97. bind 'C-\' send-prefix
  98. # Delay in sending things is dumb
  99. set-option -s escape-time 1
  100. # so we can scroll the mouse, select panes, etc...
  101. set-window-option -g mode-mouse on
  102. set-window-option -g mouse-select-pane on
  103. set-window-option -g mouse-resize-pane on
  104. set-window-option -g mouse-select-window on
  105. # Mouse mode can be stupid at times, so make it toggleable.
  106. bind-key m \
  107. if-shell \
  108. "tmux show-window-options | grep 'mode-mouse on'" \
  109. "set-window-option mode-mouse off; \
  110. set-window-option mouse-select-pane off; \
  111. set-window-option mouse-resize-pane off; \
  112. set-window-option mouse-select-window off; \
  113. display 'Mouse modes off'" \
  114. "set-window-option mode-mouse on; \
  115. set-window-option mouse-select-pane on; \
  116. set-window-option mouse-resize-pane on; \
  117. set-window-option mouse-select-window on; \
  118. display 'Mouse modes on'"
  119. # Assume linux for things, load osx stuff only on osx
  120. bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
  121. bind C-y run "tmux save-buffer - | xclip -i"
  122. # Linux specific. Now that I installed rainbarf on things, why not use it.
  123. if-shell 'test "$(uname)" = "Linux"' \
  124. "set-option -g status-right-length 55; \
  125. set-option -g status-right '#(rainbarf --bright --width 25) %a %H:%M:%S'; "
  126. # osx specific
  127. # Have to modify default command so I can ssh in.
  128. # that and rainbarf output is 42 chars long (utf8) but helpful.
  129. if-shell 'test "$(uname)" = "Darwin"' \
  130. "set-option -g default-command 'reattach-to-user-namespace -l zsh'; \
  131. set-option -g status-right-length 55; \
  132. set-option -g status-right '#(rainbarf --remaining --bolt --bright --width 25) %a %H:%M:%S'; "