-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
188 lines (138 loc) · 4.84 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
### General
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
set-option -s escape-time 0
set-option -g prefix C-t
bind-key C-t send-prefix
unbind-key C-b
# Keep the window's name fixed
set-option -g allow-rename off
# System window by supported OS
set-option -g set-titles on
set-option -g set-titles-string "[tmux] #T @ #H"
# Display time
set-option -g display-time 3500
set-option -g display-panes-time 3500
### Operations
## Clients
# Switch clients
bind-key N switch-client -n
bind-key P switch-client -p
## Window
# Start window index 1 origin
set-option -g base-index 1
# Split window
bind-key | split-window -h
# Vertical split window
bind-key - split-window -v
# Change active window
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
## Pane
# Start pane index 1 origin
set-window-option -g pane-base-index 1
# Resize pane
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
# Change active pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Rotate active pane
bind-key -n C-o run "tmux select-pane -l || tmux select-pane -t :.+"
# Break or kill pane
bind-key b break-pane
bind-key q kill-pane
bind-key C-q kill-session
bind-key C-x run "tmux kill-pane || tmux kill-window"
bind-key C-t run "tmux last-pane || tmux last-window || tmux new-window"
bind-key X kill-window
# Display pane
bind-key i display-panes
## Key-bindings
# Reload config file
bind-key r source-file ~/.tmux.conf\; display-message "[tmux] $HOME/.tmux.conf reloaded!"
bind-key C-r source-file ~/.tmux.conf\; display-message "[tmux] $HOME/.tmux.conf reloaded!"
# Look up in a web dictionary
bind-key g command-prompt -p "Google Translate en->ja:" "split-window 'source ~/.zshrc >/dev/null; gte %% | less'"
bind-key G command-prompt -p "Google Translate ja->en:" "split-window 'source ~/.zshrc >/dev/null; gtj %% | less'"
# Look up in a man-page
bind-key m command-prompt -p "Man:" "split-window 'man %%'"
# Less some files with syntax highlight
bind-key M command-prompt -p "Less:" "split-window 'which richpager && richpager -l %%'"
### Appearance
set-option -g default-terminal "screen-256color"
set-option -g pane-active-border-bg colour235
## Customize statusline
# Status-position to move the status line to the top of the screen
set-option -g status-position top
# Status-right customize
set -g status-right 'Batt: #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M '
# Enable utf-8 on statusbar
set-option -g status-utf8 on
# Reload statusbar
set-option -g status-interval 1
# Centerize
set-option -g status-justify centre
# Enable visual notification
set-window-option -g monitor-activity on
# Enable visual notification
set-option -g visual-activity on
## ColorScheme
# Solarized color scheme
set -g @colors-solarized 'light'
### Copy-mode
set-window-option -g mode-keys vi
bind-key v copy-mode \; display "Copy mode!"
bind-key C-v copy-mode \; display "Copy mode!"
bind-key C-t copy-mode \; display "Copy mode!"
bind-key p paste-buffer
# Make pbcopy/pbpaste and Vim's * register work.
set-option -g default-command "reattach-to-user-namespace -l zsh"
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind-key -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -t vi-copy Escape clear-selection
bind-key -t vi-copy C-c cancel
bind-key -t vi-copy C-v rectangle-toggle
bind-key -t vi-copy C-a start-of-line
bind-key -t vi-copy C-e end-of-line
bind-key -t vi-copy w next-word
bind-key -t vi-copy e next-word-end
bind-key -t vi-copy b previous-word
bind-key -t vi-copy g top-line
bind-key -t vi-copy G bottom-line
bind-key -t vi-copy / search-forward
bind-key -t vi-copy ? search-backward
bind-key -t vi-copy C-n scroll-up
bind-key -t vi-copy C-f scroll-down
bind-key -t vi-copy C-u page-up
bind-key -t vi-copy C-d page-down
unbind-key Space
bind-key -t vi-copy V select-line
### Misc
# Use mouse (Should be on if using tmux-scroll-copy-mode plugin)
set-option -g mouse on
# Options for tmux-sideber
set -g @sidebar-tree-command 'tree -C'
### Plugins
# Using Solarized color scheme
set -g @plugin 'seebi/tmux-colors-solarized'
# Entering and exiting copy-mode with the scroll wheel
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# Opening highlighted selection directly
set -g @plugin 'tmux-plugins/tmux-open'
# Enables displaying battery percentage and status icon
set -g @plugin 'tmux-plugins/tmux-battery'
# Restore tmux environment after system restart
set -g @plugin 'tmux-plugins/tmux-resurrect'
# A tree directory listing for the current path
set -g @plugin 'tmux-plugins/tmux-sidebar'
# Easy logging and screen capturing
set -g @plugin 'tmux-plugins/tmux-logging'
# Initialize tpm
run '~/.tmux/plugins/tpm/tpm'