-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
187 lines (148 loc) · 6.26 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
############ 達人に学ぶtmux設定 ############
## http://qiita.com/murachi1208/items/36d7676558d5535b44db ##
#
## http://qiita.com/syui/items/6a9cbd39f221d3b996a3
############################################
# Tips
############################################
#
# * C-* ... Ctrl + *
# * M-* ... Alt + *
#
# * "bind-key -r option" allows us to input commands without Prefix during the time.
#
# * "set-option" and "set-window-option" are for session and window settings respectively.
#
# * "bind-key" and "bind" have the same effect.
#
#
############################################
############################################
# Fundamental settings
############################################
# tmux-powerline setting
set-option -g status on
set-option -g status-interval 2
# set-option -g status-utf8 on
set-option -g status-bg colour235
set-option -g status-justify "left"
set-option -g status-left-length 100
set-option -g status-right-length 120
# set-option -g status-left "#(~/tmux-powerline/powerline.sh left)"
# set-option -g status-right "#(~/tmux-powerline/powerline.sh right)"
# set -g status-left "#S #[fg=green,bg=black]#(tmux-mem-cpu-load --colors --interval 2)#[default]"
# set -g status-right "#[fg=green]#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --colors --powerline-right --interval 2)#[default]"
set-window-option -g window-status-current-format "#[fg=colour235, bg=colour27]⮀#[fg=colour255, bg=colour27] #I ⮁ #W #[fg=colour27, bg=colour235]⮀"
# Prefix
set-option -g prefix C-Space
# Reload tmux.conf
bind-key r source-file ~/.tmux.conf \; display "Reload tmux.conf!!"
# Enable utf8
# set-window-option -g utf8 on
# set-window-option -g status-utf8 on
# Starting number for penes and windows
set-option -g base-index 0
set-window-option -g pane-base-index 0
# The maximum line number of window history
set-option -g history-limit 5000
# Set the sizes of main pane height and width
set-window-option -g main-pane-height 55
set-window-option -g main-pane-width 200
#### Colaborate with Vim. #####
# The following enables Esc to perform rapidly in vim
set -s escape-time 0
# Smart pane switching with awareness of vim splits
# http://qiita.com/izumin5210/items/92fd7425999980f9516d
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
############################################
# Copy mode
############################################
# Vi-like copy mode key binds
set-window-option -g mode-keys vi
# Start copy mode wiht Prefix+v
bind-key v copy-mode \; display "Copy mode!!"
# Prefix+Enter/y for copying
bind-key -t vi-copy Enter copy-pipe "xclip -i -selection clipboard"
bind-key -t vi-copy y copy-pipe "xclip -i -selection clipboard"
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
#unbind -t vi-copy Enter
# Prefix+p for pasting
bind-key p paste-buffer
# Prefix+v for selecting range
bind-key -t vi-copy v begin-selection
# Prefix+V for selecting range from the beginning of the line
bind-key -t vi-copy V select-line
# Prefix+C-v for rectangle selection
bind-key -t vi-copy C-v rectangle-toggle
# y for copying
bind-key -t vi-copy y copy-selection
# Y for one-line copying
bind-key -t vi-copy Y copy-line
############################################
# Pane
############################################
# Divide a window (generate a pane) horizontally (Prefix+-) and vertically (Prefix+|)
bind-key | split-window -h
bind-key - split-window -v
# Prefix + Ctrl-h/l for switching panes
# Prefix + Ctrl-h,h,h,h,...
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Ctrl-o also allows us to switch panes without prefix
#bind-key -n C-o select-pane -t :.+
# Prefix+hjkl for moving from current pane to another 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
# Prefix+JKHL for resizing a pane
# Prefix+J,J,J,J,...
bind-key -r H resize-pane -L 1
bind-key -r J resize-pane -D 1
bind-key -r K resize-pane -U 1
bind-key -r L resize-pane -R 1
############################################
# Appearance
############################################
set-option -g default-terminal screen-256color
set-option -g terminal-overrides 'xterm:colors=256'
# Colors for status bar
set-option -g status-fg white
set-option -g status-bg black
# Colors for window lists
set-window-option -g window-status-fg cyan
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# Make the active window obvious
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-attr bright
# Colors for pane border
set-option -g pane-border-fg black
#set-option -g pane-border-bg black
# Make the active pane obvious
set-option -g pane-active-border-fg blue
#set-option -g pane-active-border-bg blue
# Colors for command line
set-option -g message-fg white
set-option -g message-bg black
set-option -g message-attr bright
# Load conf file from tmuxline.vim
source-file ~/.tmux/tmuxline.conf
# Reload binding
bind r source-file ~/.tmux.conf\; display "Reloaded!"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'thewtex/tmux-mem-cpu-load'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'