-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_tmux.conf
171 lines (137 loc) · 4.49 KB
/
dot_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
set-option -g default-terminal "tmux-256color"
# Add truecolor support
# favor RGB over Tc for tmux 3.2 or later - https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
set-option -ga terminal-overrides ",*-256color*:RGB"
set-option -sa terminal-features ',xterm-kitty:RGB'
set -as terminal-overrides ',tmux*:sitm=\E[3m' # Italics support
# Strikethrough support https://github.com/tmux/tmux/issues/612#issuecomment-288408841
set -as terminal-overrides ',tmux*:smxx=\E[9m'
set -ga terminal-features '*:clipboard:strikethrough:usstyle:RGB'
set -g default-command /usr/bin/zsh
set -g base-index 1
set -g history-limit 999999
# No noise activity
# it makes tmux-thumbs and other tmux plugins to response quicker
set -g visual-activity off
set -g visual-bell off
set -g visual-silence on
# Required by kutsan/zsh-system-clipboard
# set-option -g set-clipboard on
# vim key bindings in tmux command prompt
setw -g mode-keys vi
set -g status-keys vi
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# Focus events enabled for terminals that support them
set -g focus-events on
# Command prefix (like screen)
set-option -g prefix C-a
bind C-a send-prefix
# Tmux Prefix Plus a, go last window
bind C-a last-window
# Allow scroll in panel and tmux
# Need to select text with shift and double mouse click
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" \
"send-keys -M" "if -Ft= '#{pane_in_mode}' \
'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Disable C-a C-z. No need to suspend tmux
unbind ^z
# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client
# reload config without killing server
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Paste from primary, instead of ]
bind p paste-buffer
# https://scripter.co/command-to-every-pane-window-session-in-tmux/
# Seed the same command to all panes/windows in the current session
bind C-e command-prompt -p "Command:" \
"run \"tmux list-panes -s -F '##{session_name}:##{window_index}.##{pane_index}' \
| xargs -I PANE tmux send-keys -t PANE '%1' Enter\""
bind X run 'tmux list-sessions -F "##S" | xargs -n1 tmux kill-session -C -t'
# Send 'tmux-prefix + y' to zsh to copy current zle line to clipboard
bind-key y send-prefix\; send-keys 'y'
#
# Plugin settings
#
# Last saved environment is automatically restored when tmux is started
set -g @continuum-restore 'on'
#
# tmux-resurrect
#
# Enables saving and restoring tmux pane content
set -g @resurrect-capture-pane-contents 'on'
# Restore neovim session
set -g @resurrect-strategy-nvim 'session'
#
# easy-motion-prefix
#
bind-key v next-layout
bind-key -T copy-mode-vi v send-keys -X begin-selection
set -g @easy-motion-default-key-bindings 'off'
set -g @easy-motion-default-motion "bd-w"
set -g @easy-motion-prefix "s"
set -g @easy-motion-copy-mode-prefix "s"
#
# tmux-power
#
set -g @tmux_power_theme 'snow'
# 'L' for left only, 'R' for right only and 'LR' for both
set -g @tmux_power_prefix_highlight_pos 'LR'
#
# tmux-thumbs
#
set -g @thumbs-reverse enabled
set -g @thumbs-command "printf '%s' {} | cb copy"
set -g @thumbs-upcase-command "tmux set-buffer {} && printf '%s' {} | cb copy && tmux paste-buffer"
#
# tmux-resurrect
#
# Avoid keep hinting ctrl+a+s when saving a file
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
#
# tmux-fingers
#
set -g @fingers-key space
#
# tmux-fuzzback
#
set -g @fuzzback-popup 1
set -g @fuzzback-hide-preview 1
set -g @fuzzback-popup-size '80%'
set -g @fuzzback-bind '/'
#
# Plugins section
#
# List of plugins
# Supports `github_username/repo` or full git URLs
# prefix + shift + i for install plugins
# prefix + shift + u for update plugins
set -g @tpm_plugins " \
odedlaz/tmux-onedark-theme \
IngoMeyer441/tmux-easy-motion \
Morantron/tmux-fingers \
roosta/tmux-fuzzback \
tmux-plugins/tmux-continuum \
tmux-plugins/tmux-logging \
tmux-plugins/tmux-pain-control \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-yank \
tmux-plugins/tpm \
wfxr/tmux-power \
"
# Initializes TMUX plugin manager
run-shell ~/.tmux/plugins/tpm/tpm
#
# keep them at the end as they are overwritten by plugins
#
# set statusbar to the top
set-option -g status-position top
# centralize statusbar
set-option -g status-justify centre
# vim:ft=tmux.conf ts=2 sw=2