Chinaunix首页 | 论坛 | 博客
  • 博客访问: 154319
  • 博文数量: 11
  • 博客积分: 1198
  • 博客等级: 少尉
  • 技术积分: 335
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-10 11:48
文章分类

全部博文(11)

文章存档

2013年(2)

2012年(1)

2010年(2)

2009年(4)

2008年(2)

我的朋友

分类: LINUX

2012-07-28 23:16:13

  

点击(此处)折叠或打开

  1. #!/bin/bash
  2. tmux new-session -d -s session_name
  3. tmux new-window -t session_name:1 -n 'local'
  4. tmux new-window -t session_name:2 -n 'login' 'ssh login'
  5. tmux new-window -t session_name:3 -n 'backup' 'ssh backup'
  6. tmux new-window -t session_name:4 -n 'devel' 'ssh devel'
  7. tmux select-window -t session_name:1
  8. tmux attach-session -t session_name

点击(此处)折叠或打开

  1. #------------------------------------------------------------------------------#
  2. # vi: set sw=4 ts=4 ai: ("set modeline" in ~/.exrc) #
  3. #------------------------------------------------------------------------------#
  4. # Config file : ~/.tmux.conf #
  5. # #
  6. # Author : Ton Kersten The Netherlands #
  7. #------------------------------------------------------------------------------#
  8. # I use all Alt-Keys instead of Ctrl. This because I use a lot of Ctrl in
  9. # Vim and so on and I don't like to use the Prefix all the time.
  10. # And.... this also works on OSX with iTerm2
  11. # Set that stupid Esc-Wait off, so VI works again
  12. set-option -sg escape-time 0
  13. # Set the prefix to Alt-A
  14. set-option -g prefix M-a
  15. bind-key M-a send-prefix
  16. # All kind of nice options
  17. set-option -g bell-action any
  18. set-option -g default-terminal screen
  19. set-option -g display-panes-colour red
  20. set-option -g history-limit 100000
  21. set-option -g message-bg red
  22. set-option -g message-fg white
  23. set-option -g mouse-select-pane off
  24. set-option -g pane-active-border-bg default
  25. set-option -g pane-active-border-fg red
  26. set-option -g pane-border-bg default
  27. set-option -g pane-border-fg cyan
  28. set-option -g repeat-time 500
  29. set-option -g visual-activity off
  30. set-option -g visual-bell on
  31. set-option -g set-titles on
  32. set-option -g set-titles-string ' #I-#W '
  33. set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
  34. set-option -g base-index 1
  35. set-option -g default-path ""
  36. # Screen lock
  37. bind-key C-x lock-server
  38. bind-key x lock-server
  39. bind-key -n M-x lock-server
  40. set-option -g lock-after-time 0
  41. set-option -g lock-server on
  42. set-option -g lock-command "vlock"
  43. # statusbar
  44. set-option -g status-utf8 on
  45. set-option -g status-interval 5
  46. set-option -g status-justify left
  47. set-option -g status-left-length 15
  48. set-option -g status-left ' #h |'
  49. set-option -g status-right ' | %Y-%m-%d %H:%M #[default]'
  50. # default statusbar colors
  51. set-option -g status-fg white
  52. set-option -g status-bg blue
  53. set-option -g status-attr bright
  54. set-option -g status-keys emacs
  55. # default window title colors
  56. set-window-option -g window-status-fg white
  57. set-window-option -g window-status-bg blue
  58. set-window-option -g window-status-attr dim
  59. # active window title colors
  60. set-window-option -g window-status-current-fg yellow
  61. set-window-option -g window-status-current-bg red
  62. set-window-option -g window-status-current-attr bright
  63. #
  64. set-window-option -g mode-fg white
  65. set-window-option -g mode-bg red
  66. set-window-option -g mode-attr bright
  67. # Window options
  68. set-window-option -g utf8 on
  69. set-window-option -g clock-mode-colour blue
  70. set-window-option -g clock-mode-style 24
  71. set-window-option -g monitor-activity on
  72. set-window-option -g xterm-keys on
  73. set-window-option -g automatic-rename on
  74. set-window-option -g aggressive-resize off
  75. #
  76. set-window-option -g window-status-format ' #I-#W '
  77. set-window-option -g window-status-current-format ' #I-#W '
  78. # Remap keys to my settings
  79. unbind-key M-d ; bind-key -n M-d detach-client
  80. unbind-key d ; bind-key d detach-client
  81. unbind-key M-c ; bind-key -n M-c command-prompt -p "tmux:"
  82. unbind-key M-m ; bind-key -n M-m command-prompt -p "Man:" "split-window 'man %%'"
  83. unbind-key Tab ; bind-key Tab choose-window
  84. unbind-key M-w ; bind-key -n M-w choose-window
  85. unbind-key M-e ; bind-key -n M-e choose-session
  86. unbind-key M-t ; bind-key -n M-t new-window
  87. unbind-key t ; bind-key t new-window
  88. unbind-key M-` ; bind-key -n M-` last-window
  89. unbind-key n ; bind-key n next-window
  90. unbind-key p ; bind-key p previous-window
  91. unbind-key M-n ; bind-key -n M-n next-window
  92. unbind-key M-p ; bind-key -n M-p previous-window
  93. unbind-key M-right ; bind-key -n M-right next-window
  94. unbind-key M-left ; bind-key -n M-left previous-window
  95. # Window selection
  96. unbind-key 1 ; bind-key 1 select-window -t 1
  97. unbind-key 2 ; bind-key 2 select-window -t 2
  98. unbind-key 3 ; bind-key 3 select-window -t 3
  99. unbind-key 4 ; bind-key 4 select-window -t 4
  100. unbind-key 5 ; bind-key 5 select-window -t 5
  101. unbind-key 6 ; bind-key 6 select-window -t 6
  102. unbind-key 7 ; bind-key 7 select-window -t 7
  103. unbind-key 8 ; bind-key 8 select-window -t 8
  104. unbind-key 9 ; bind-key 9 select-window -t 9
  105. unbind-key 0 ; bind-key 0 select-window -t 10
  106. unbind-key M-1 ; bind-key -n M-1 select-window -t 1
  107. unbind-key M-2 ; bind-key -n M-2 select-window -t 2
  108. unbind-key M-3 ; bind-key -n M-3 select-window -t 3
  109. unbind-key M-4 ; bind-key -n M-4 select-window -t 4
  110. unbind-key M-5 ; bind-key -n M-5 select-window -t 5
  111. unbind-key M-6 ; bind-key -n M-6 select-window -t 6
  112. unbind-key M-7 ; bind-key -n M-7 select-window -t 7
  113. unbind-key M-8 ; bind-key -n M-8 select-window -t 8
  114. unbind-key M-9 ; bind-key -n M-9 select-window -t 9
  115. unbind-key M-0 ; bind-key -n M-0 select-window -t 10
  116. # Window splitting
  117. unbind-key M-- ; bind-key -n M-- split-window -v
  118. unbind-key M-\ ; bind-key -n M-\ split-window -h
  119. unbind-key \ ; bind-key \ split-window -h
  120. unbind-key | ; bind-key | split-window -h
  121. unbind-key - ; bind-key - split-window -v
  122. # Pane selection and resizing
  123. unbind-key left ; bind-key left select-pane -L
  124. unbind-key up ; bind-key up select-pane -U
  125. unbind-key down ; bind-key down select-pane -D
  126. unbind-key right ; bind-key right select-pane -R
  127. unbind-key C-h ; bind-key C-h select-pane -L
  128. unbind-key C-k ; bind-key C-k select-pane -U
  129. unbind-key C-j ; bind-key C-j select-pane -D
  130. unbind-key C-l ; bind-key C-l select-pane -R
  131. unbind-key j ; bind-key -r j resize-pane -D 5
  132. unbind-key k ; bind-key -r k resize-pane -U 5
  133. unbind-key h ; bind-key -r h resize-pane -L 5
  134. unbind-key l ; bind-key -r l resize-pane -R 5
  135. unbind-key C-left ; bind-key -r C-left resize-pane -L 1
  136. unbind-key C-right ; bind-key -r C-right resize-pane -R 1
  137. unbind-key C-up ; bind-key -r C-up resize-pane -U 1
  138. unbind-key C-down ; bind-key -r C-down resize-pane -D 1
  139. unbind-key @ ; bind-key @ confirm-before kill-window
  140. unbind-key M-r ; bind-key -n M-r source-file ~/.tmux.conf
  141. unbind-key q ; bind-key q list-keys
  142. unbind-key M-q ; bind-key -n M-q list-keys
  143. # Copy mode
  144. set-window-option -g mode-keys vi
  145. set-window-option -g mode-mouse off
  146. set-option buffer-limit 10
  147. unbind-key M-NPage ; bind-key -n M-NPage copy-mode
  148. unbind-key M-PPage ; bind-key -n M-PPage copy-mode
  149. unbind-key M-i ; bind-key -n M-i paste-buffer
  150. unbind-key -t vi-copy M-{ ; bind-key -t vi-copy M-{ begin-selection
  151. unbind-key -t vi-copy M-} ; bind-key -t vi-copy M-} copy-selection
  152. unbind-key -t vi-copy Home ; bind-key -t vi-copy Home start-of-line
  153. unbind-key -t vi-copy End ; bind-key -t vi-copy End end-of-line
  154. unbind-key -t vi-copy b ; bind-key -t vi-copy b rectangle-toggle

阅读(1414) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~