Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. # use UTF8
  2. # set -g utf8
  3. # set-window-option -g utf8 on
  4.  
  5. # make tmux display things in 256 colors
  6. set -g default-terminal "screen-256color"
  7.  
  8. # set scrollback history to 10000 (10k)
  9. set -g history-limit 10000
  10.  
  11. # set Ctrl-a as the default prefix key combination
  12. # and unbind C-b to free it up
  13. set -g prefix C-s
  14. unbind C-b
  15.  
  16. # use send-prefix to pass C-a through to application
  17. bind a send-prefix
  18.  
  19. # shorten command delay
  20. set -sg escape-time 1
  21.  
  22. # set window and pane index to 1 (0 by default)
  23. set-option -g base-index 1
  24. setw -g pane-base-index 1
  25.  
  26. # reload ~/.tmux.conf using PREFIX r
  27. bind r source-file ~/.tmux.conf \; display "Reloaded!"
  28.  
  29. # use PREFIX | to split window horizontally and PREFIX - to split vertically
  30. bind | split-window -h
  31. bind - split-window -v
  32.  
  33. # Make the current window the first window
  34. bind T swap-window -t 1
  35.  
  36. # map Vi movement keys as pane movement keys
  37. bind h select-pane -L
  38. bind j select-pane -D
  39. bind k select-pane -U
  40. bind l select-pane -R
  41.  
  42. # and use C-h and C-l to cycle thru panes
  43. bind -r C-h select-window -t :-
  44. bind -r C-l select-window -t :+
  45.  
  46. # resize panes using PREFIX H, J, K, L
  47. bind H resize-pane -L 5
  48. bind J resize-pane -D 5
  49. bind K resize-pane -U 5
  50. bind L resize-pane -R 5
  51.  
  52. # C-o or simply o, will cycle through panes
  53. bind C-o select-pane -t :.+
  54. bind o select-pane -t :.+
  55.  
  56. # explicitly disable mouse control
  57. # setw -g mode-mouse off
  58. # set -g mouse-select-pane off
  59. # set -g mouse-resize-pane off
  60. # set -g mouse-select-window off
  61.  
  62. # ---------------------
  63. # Copy & Paste
  64. # ---------------------
  65. # provide access to the clipboard for pbpaste, pbcopy
  66. set-option -g default-command "reattach-to-user-namespace -l zsh"
  67. set-window-option -g automatic-rename on
  68.  
  69. #
  70. # use vim keybindings in copy mode
  71. setw -g mode-keys vi
  72. #
  73. # setup 'v' to begin selection as in Vim
  74. bind-key -t vi-copy v begin-selection
  75. bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
  76.  
  77. # update default binding of 'Enter' to also use copy-pipe
  78. unbind -t vi-copy Enter
  79. bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
  80.  
  81. bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
  82. bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
  83.  
  84. # ----------------------
  85. # set some pretty colors
  86. # ----------------------
  87. # set pane colors - hilight the active pane
  88. set-option -g pane-border-fg colour235 #base02
  89. set-option -g pane-active-border-fg colour240 #base01
  90.  
  91. # colorize messages in the command line
  92. set-option -g message-bg black #base02
  93. set-option -g message-fg brightred #orange
  94.  
  95. # ----------------------
  96. # Status Bar
  97. # -----------------------
  98.  
  99. # 自动重新编号 window
  100. set -g renumber-windows on
  101.  
  102. # 设置自动刷新的时间间隔
  103. set -g status-interval 1
  104. # 状态栏左对齐
  105. set -g status-justify left
  106. # 状态栏左侧宽度
  107. set -g status-left-length 20
  108. # 状态栏右侧宽度
  109. set -g status-right-length 50
  110.  
  111. # 状态栏背景颜色
  112. set -g status-bg '#333333'
  113. # 状态栏前景颜色
  114. set -g status-fg '#ffffff'
  115. # 状态栏左侧显示 session 的名字
  116. set -g status-left '#[bg=#00bb00] [#S] #[default] '
  117. # 状态栏右侧显示时间
  118. #set -g status-right '#[fg=white,bg=#55bb00] [#h] #[fg=white,bg=#009c00] %Y-%m-%d #[fg=white,bg=#007700] %H:%M:%S '
  119. set -g status-right '#[fg=white,bg=#444444] [#h] #[fg=white,bg=#666666] %Y-%m-%d #[fg=white,bg=#888888] %H:%M:%S '
  120.  
  121. # 当前激活窗口在状态栏的展位格式
  122. setw -g window-status-current-format '#[bg=#ff0000, fg=#ffffff, bold]*[#I] #W*'
  123. # 未激活每个窗口占位的格式
  124. setw -g window-status-format '#[bg=#0000ff, fg=#ffffff] [#I] #W '
  125.  
  126.  
  127.  
  128. # show session name, window & pane number, date and time on right side of
  129. # status bar
  130. set -g status-right-length 60
  131. set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
  132.  
  133. # 不要修改window的名字
  134. set-option -g allow-rename off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement