-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
159 lines (127 loc) · 4.63 KB
/
tmux.conf
File metadata and controls
159 lines (127 loc) · 4.63 KB
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
#set Zsh as your default Tmux shell
# if-shell "uname | grep -q Darwin" {
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# }{
# set-option -g default-shell /bin/zsh
# }
# UTF is great, let us use that
# set -g utf8
# set-window-option -g utf8 on
#
# Tmux should be pretty, we need 256 color for that
# set -g default-terminal "screen-256color"
#
# # act like vim
setw -g mode-keys vi
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
#Split window
bind-key v split-window -h -c "#{pane_current_path}"
bind-key S split-window -v -c "#{pane_current_path}"
#Create new window
bind c new-window -c '#{pane_current_path}'
#Use mouse
#2.0
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
#2.1
set -g mouse on
set -g focus-events on
# switch windows alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# Scroll History
set -g history-limit 30000
# Clear the history buffer
bind-key C-l send-keys 'C-l' \; clear-history
# Tmux uses a 'control key', let's set it to 'Ctrl-a'
# Reason: 'Ctrl-a' is easier to reach than 'Ctrl-b'
#set -g prefix C-a
#unbind C-b
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# command delay? We don't want that, make it short
set -sg escape-time 1
# Set the numbering of windows to go from 1 instead
set-option -g base-index 1
setw -g pane-base-index 1
#Copy to system clipbord
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -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"
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
}
# status line
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
set -g status-left ''
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
bind-key -T copy-mode-vi WheelUpPane send -N1 -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
bind-key -T copy-mode-vi WheelUpPane send -N1 -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
# The modes
setw -g clock-mode-colour colour135
# The statusbar
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S'
set -g status-right-length 50
set -g status-left-length 20
set -g window-status-current-format "#[fg=colour233,bg=colour63]#[fg=colour255,bg=colour63] #I#F:#W #[fg=colour63,bg=colour233,nobold]"
set -g window-status-format " #I#F:#W"
# Toggle to solve nested tmux session problem
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
refresh-client -S
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
set -g status-right "$wg_is_keys_off #[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S "
#####################
######################
#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
# Allow us to reload our Tmux configuration while
# using Tmux
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TPM (Tmux Plugin Manager) - keep this line at the very bottom
run '~/.tmux/plugins/tpm/tpm'