-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
103 lines (79 loc) · 3.79 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
set -g default-shell /usr/bin/zsh
# [prefix-q] 展示窗口数字并选择跳转
bind-key q display-panes
# bind-key a last-pane # 绑什么好?
# -------------------------------- pane end --------------------------------
# -------------------------------- move/copy/paste begin --------------------------------
# use vi mode
# vi is good 把 Tmux 设为 vi 模式,使其与 Vim 的操作更加接近
setw -g mode-keys vi
# [ 进入复制,space键开始选择问题 方向键移动, / 回车复制 / ] 黏贴
bind-key [ copy-mode
bind-key ] paste-buffer
# Copy and paste like in vim
# p 换成paste
unbind p
bind p paste-buffer
# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi Escape send-keys -X cancel
bind-key -T copy-mode-vi H send-keys -X start-of-line
bind-key -T copy-mode-vi L send-keys -X end-of-line
# Update default binding of `Enter` to also use copy-pipe
unbind-key -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# for osx
# Enable native Mac OS X copy/paste 对于mac用户,可以复制到系统剪贴板
set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
# -------------------------------- move/copy/paste end --------------------------------
# -------------------------------- mouse begin --------------------------------
# mouse behavior
# Using set -gq instead of set -g will silence the unknown option error, while still setting it on old versions of tmux
setw -gq mode-mouse on
set -gq mouse-select-pane on
set -gq mouse-resize-pane on
set -gq mouse-select-window on
set -g mouse on
# -------------------------------- mouse end --------------------------------
# -------------------------------- status line begin --------------------------------
# 颜色
# set-option -g status-bg black
# set-option -g status-fg white
set -g status-bg '#4e4e4e'
set -g status-fg '#bbbbbb'
set -g status-left-fg '#bbbbbb'
set -g status-left-bg '#4e4e4e'
set -g status-right-fg '#bbbbbb'
set -g status-right-bg '#4e4e4e'
set -g status-left-length 90
set -g status-right-length 60
# 对齐方式
set-option -g status-justify centre
# 左下角
# set-option -g status-left '#[bg=black,fg=green][#[fg=cyan]#S#[fg=green]]'
set-option -g status-left "S-#S:W-#I:P-#P"
# 窗口列表
setw -g automatic-rename on
# set-window-option -g window-status-current-fg magenta
set-window-option -g window-status-format '#[dim]#I:#[dim]#W#[fg=grey,dim]'
set-window-option -g window-status-current-format '[#[fg=white,bold]#I#[fg=white,bold]:#[fg=white,bold]#W#[fg=dim]]'
# 右下角
set -g status-right '#[fg=green][#[fg=white]%m-%d %H:%M#[fg=green]]'
# -------------------------------- status line end --------------------------------
# -------------------------------- color begin --------------------------------
# pane border colors
set-option -g pane-active-border-fg '#55ff55'
set-option -g pane-border-fg '#555555'
# set -g pane-border-fg colour245
# set -g pane-active-border-fg colour39
# -------------------------------- color end --------------------------------
#--------------------------- base config end -------------------------------
# set default shell
set -g default-command /usr/bin/zsh
set -g default-shell /usr/bin/zsh