-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmuxen.tmux.conf
executable file
·141 lines (118 loc) · 4.51 KB
/
tmuxen.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#check if using zsh
MYBASEDIR='$MYRUNTIME'
#-- base settings --#
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g escape-time 0
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
#-- bindkeys --#
# prefix key (Ctrl+a)
set -g prefix ^a
unbind ^b
bind a send-prefix
# split window
unbind '"'
bind _ splitw -v # vertical split (prefix -)
unbind %
bind | splitw -h # horizontal split (prefix |)
# select pane
bind k selectp -U # above (prefix k)
bind j selectp -D # below (prefix j)
bind h selectp -L # left (prefix h)
bind l selectp -R # right (prefix l)
# resize pane
bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)
# swap pane
bind ^u swapp -U # swap with the previous pane (prefix Ctrl+u)
bind ^d swapp -D # swap with the next pane (prefix Ctrl+d)
# misc
bind e lastp # select the last pane (prefix e)
bind ^e last # select the last window (prefix Ctrl+e)
bind q killp # kill pane (prefix q)
bind ^q killw # kill window (prefix Ctrl+q)
# copy mode
bind Escape copy-mode # enter copy mode (prefix Escape)
bind ^p pasteb # paste buffer (prefix Ctrl+p)
bind -t vi-copy v begin-selection # select (v)
bind -t vi-copy y copy-selection # copy (y)
# app
bind ! splitw htop # htop (prefix !)
bind m command-prompt "splitw 'exec man %%'" # man (prefix m)
bind @ command-prompt "splitw 'exec perldoc -t -f %%'" # perl func (prefix @)
bind * command-prompt "splitw 'exec perldoc -t -v %%'" # perl var (prefix *)
bind % command-prompt "splitw 'exec perldoc -t %%'" # perl doc (prefix %)
bind / command-prompt "splitw 'exec ri %%'" # ruby doc (prefix /)
# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"
#-- statusbar --#
#set -g status-utf8 on
#set -g status-position top
set -g status-interval 1
set -g status-keys vi
setw -g mode-keys vi
setw -g automatic-rename off
#-- colorscheme --#
# see also: https://github.com/daethorian/conf-tmux/blob/master/colors/zenburn.conf
# modes
setw -g clock-mode-colour colour223
setw -g mode-attr bold
setw -g mode-fg colour223
setw -g mode-bg colour235
# panes
set -g pane-border-bg colour234
set -g pane-border-fg colour234
set -g pane-active-border-bg colour232
set -g pane-active-border-fg colour232
# statusbar
set -g status-justify centre
set -g status-bg colour235
set -g status-fg colour248
set -g status-attr dim
set -g status-left "#[default]» #[fg=colour187]#S #[default]• #[fg=colour187]w#I.p#P#[default]"
set -g status-left-attr bright
set -g status-left-length 50
set -g status-right "#[fg=colour174]# #[default]• #[fg=colour174]#(cut -d ' ' -f 1-3 /proc/loadavg)"
set -g status-right-attr bright
set -g status-right-length 60
setw -g window-status-current-fg colour223
setw -g window-status-current-bg colour237
setw -g window-status-current-attr bold
setw -g window-status-current-format "#I:#W#F"
#setw -g window-status-alert-attr bold
#setw -g window-status-alert-fg colour255
#setw -g window-status-alert-bg colour160
# messages
set -g message-attr bold
set -g message-fg colour223
set -g message-bg colour235
set-option -g status on
set-option -g status-interval 2
#set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 90
set-option -g status-right-length 90
set-option -g status-left "#($MYBASEDIR/tmux-powerline/powerline.sh left)"
set-option -g status-right "#($MYBASEDIR/tmux-powerline/powerline.sh right)"
set-window-option -g window-status-current-format "#[fg=colour235, bg=colour27]⮀#[fg=colour255, bg=colour27] #I ⮁ #W #[fg=colour27, bg=colour235]⮀"
bind C-= run '$MYBASEDIR/tmux-powerline/mute_powerline.sh left' # Mute left statusbar.
bind C-- run '$MYBASEDIR/tmux-powerline/mute_powerline.sh right' # Mute right statusbar.
#[鼠标模式]
set -g mouse on
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
#
#鼠标滚动事件
#这种情况下,Vi/Emacs等全屏程序并不受影响,还可以自己接管滚轮事件
#setw mode-mouse on #如果要启用鼠标滚轮来卷动窗口内容的话,可以按C-b :然后输入
#setw -g mode-mouse on #如果要对所有窗口开启的话
# set-window-option -g mode-mouse on #也可以加到~/.tmux.conf里面
#[设置tmuxinator的设置]
set-option -g base-index 1
set-window-option -g pane-base-index 1