-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
166 lines (140 loc) · 4.27 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
set-option -sg escape-time 10
set-option -g focus-events on
# Eable mouse operation
set-option -g mouse on
# Use vi key to turn pages and copy
setw -g mode-keys vi
setw -g status-keys vi
# Increase history capacity
set -g history-limit 50000
# Set terminal 256color
set -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ",*256col*:Tc"
# display
set -g base-index 1
setw -g pane-base-index 1
setw -g automatic-rename on
set -g renumber-windows on
set -g display-panes-time 2000
set -g display-time 2000
setw -g monitor-activity on
set -g visual-activity off
# Bind second prefix key
set-option -g prefix2 C-x
# Open new window in current path
bind c new-window -c "#{pane_current_path}"
# reload configuration
bind r source-file ~/.config/tmux/tmux.conf \; display 'tmux.conf sourced'
# create session
bind C-c new-session
# window management
bind -n M-o new-window -c "#{pane_current_path}"
bind -n M-O break-pane
bind -n M-Q kill-pane
# window navigation
unbind n
unbind p
unbind 1
unbind 2
unbind 3
unbind 4
unbind 5
unbind 6
unbind 7
unbind 8
unbind 9
unbind 0
bind -r C-p previous-window
bind -r C-n next-window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# split window: up down left right
bind K split-window -vb -c "#{pane_current_path}"
bind J split-window -v -c "#{pane_current_path}"
bind H split-window -hb -c "#{pane_current_path}"
bind L split-window -h -c "#{pane_current_path}"
# pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind 1 select-pane -t:.1
bind 2 select-pane -t:.2
bind 3 select-pane -t:.3
bind 4 select-pane -t:.4
bind 5 select-pane -t:.5
bind 6 select-pane -t:.6
bind 7 select-pane -t:.7
bind 8 select-pane -t:.8
bind 9 select-pane -t:.9
bind 0 select-pane -t:.10
bind > swap-pane -D
bind < swap-pane -U
bind | swap-pane
bind -n M-Space next-layout
## move pane
bind S choose-tree 'move-pane -v -s "%%"'
bind V choose-tree 'move-pane -h -s "%%"'
bind -n M-! join-pane -t :1
bind -n M-@ join-pane -t :2
bind -n 'M-#' join-pane -t :3
bind -n 'M-$' join-pane -t :4
bind -n M-% join-pane -t :5
bind -n M-^ join-pane -t :6
bind -n M-& join-pane -t :7
bind -n M-* join-pane -t :8
bind -n M-( join-pane -t :9
# pane resizing
bind -r C-h resize-pane -L 3
bind -r C-j resize-pane -D 3
bind -r C-k resize-pane -U 3
bind -r C-l resize-pane -R 3
# kill pane
bind X kill-pane
# copy mode-keys
bind -n M-v copy-mode
bind b list-buffers
bind p paste-buffer
# toggle_syn_input
bind C-g if-shell '[[ $(tmux showw synchronize-panes | cut -d\ -f2) == "on" ]]' \
'setw synchronize-panes off; set -g pane-border-style fg=magenta' \
'setw synchronize-panes on; set -g pane-border-style fg=red'
# -- toggle_status
bind t if-shell '[[ $(tmux show -g status | cut -d\ -f2) == "on" ]]' \
'set -g status off' \
'set -g status on'
# =====================================
# === Appearence and status bar ===
# ======================================
set -g status-position top
## Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @catppuccin_pane_active_border_style "fg=cyan" # Use a value compatible with the standard tmux 'pane-border-active-style'
set -g @catppuccin_status_background "default"
set -g @catppuccin_date_time_text "%Y-%m-%d"
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " █"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_status_modules_right "directory user host session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{pane_current_path}"
# Initialize TMUX plugin manager
run '~/.config/tmux/plugins/tpm/tpm'