-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
157 lines (120 loc) · 4.95 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
# ==========================
# === General settings ===
# ==========================
# Change prefix key to C-a
unbind C-b
set -g prefix C-a
# Shell
set-option -g default-shell /usr/bin/zsh
# VI mode
setw -g mode-keys vi
# Clipboard
set -s set-clipboard on
# set -as terminal-features ',xterm-256color:clipboard'
# set -sa terminal-features ',xterm-256color:Tclipboard'
# set -sa terminal-features ',tmux-256color:Tclipboard'
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# Start index of window/pane with 1
set -g base-index 1
setw -g pane-base-index 1
# Enable mouse support
set -g mouse on
# Renumber windows
set -g renumber-windows on
# Nvim passthrough
set -g allow-passthrough on
# Activity monitoring
# setw -g monitor-activity on
# Set terminal title
set -g set-titles on
set -g set-titles-string "#I:#W"
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
# Keep plenty of history for scrollback
set -g history-limit 99999999
# Status bar
set-option -g status-justify "centre"
set-option -g status-interval 1
set -g status-left-length 100
# set -g status-left ' [#H] #S #{prefix_highlight} '
set -g status-left ' #H #[fg=green,bg=colour065,nobold,nounderscore,noitalics]#[fg=colour159,bg=colour065] [#S]* #[fg=colour065,bg=green,nobold,nounderscore,noitalics]#[default] #(exec tmux ls| cut -d ":" -f 1 | grep -v #S | xargs -I _ echo " [_] " | xargs) '
set -g status-right-length 150
set -g status-right "|#{cpu_bg_color} CPU:#{cpu_percentage} #[fg=black,bg=green]|#{ram_bg_color} RAM:#{ram_percentage} #[fg=black,bg=green]| %a %m-%d %I:%M %p |"
set-option -g window-status-format "#I:#W#F"
set-option -g window-status-current-format "#[fg=colour159,bg=colour022] #I:#W #[default]"
# ==========================
# === Key bindings ===
# ==========================
# Switch window,
bind-key C-a last-window
# Use vim-like keys for splits and windows
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
# Hide pane and restore
bind-key ! break-pane -d -n _hidden_pane
bind-key @ join-pane -s $.0
# Pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# Resize
bind -n C-S-Left resize-pane -L 5
bind -n C-S-Right resize-pane -R 5
bind -n C-S-Down resize-pane -D 5
bind -n C-S-Up resize-pane -U 5
# Clear history
bind L send-keys C-l \; send-keys -R \; clear-history
# Reload config
bind r source-file ~/.tmux.conf \; display-message "config reloaded"
# New window with name
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# Kill pane/window/session shortcuts
bind x kill-pane
bind X kill-window
bind Q confirm-before -p "kill-session #S? (y/n)" kill-session
# Detach from session
bind d detach
# ============================
# === Copy mode ===
# ============================
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -in -se c -r -d :10.0'
# bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -in -se c -r -d :1'
# ============================
# === Plugins ===
# ============================
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'schasse/tmux-jump'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'laktak/extrakto'
# set -g @continuum-restore 'on'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_prompt 'cp'
set -g @prefix_highlight_empty_prompt ' '
set -g @screen-capture-key 'M-y'
set -g @save-complete-history-key 'M-Y'
set -g @jump-key 'f'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'