forked from rafamoreira/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
223 lines (181 loc) · 7.41 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
set -g @plugin 'akohlbecker/aw-watcher-tmux'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'
###############################################################################
# remap prefix from 'C-b' to 'C-a' #
###############################################################################
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
###############################################################################
# configs #
###############################################################################
# change index to start at 1 instead of 0 that is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
#prevent rename custom named windows
set-option -g allow-rename off
# TODO: discover what this does
set-option -g set-titles on
# TODO: discover what this does
set -g default-terminal screen-256color
# make vim colors work inside tmux
set-option -ga terminal-overrides ',alacritty:RGB'
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g status-keys emacs
set -g history-limit 500000
# TODO: discover what this does
setw -g mode-keys vi
setw -g mouse on
setw -g monitor-activity on
# THEME SETTINGS
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, weather, time
set -g @dracula-plugins "git"
set -g @dracula-show-flags true
set -g @dracula-refresh-rate 5
# it can accept `session`, `smiley`, `window`, or any character.
set -g @dracula-show-left-icon session
# default is false
# set -g @dracula-git-no-untracked-files true
###############################################################################
# bindings / remaps #
###############################################################################
bind r source-file ~/.tmux.conf
# split vertically and horizontally vim like
unbind-key v
bind-key v split-window -h
unbind-key s
bind-key s split-window -v
###############################################################################
# Pane Navigation #
###############################################################################
# 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
# Vim style pane selection
# TODO: make this work or remove it
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
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 J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# THEME
# set -g status-bg black
# set -g status-fg white
# set -g window-status-current-bg white
# set -g window-status-current-fg black
# set -g window-status-current-attr bold
# set -g status-interval 60
# set -g status-left-length 30
# set -g status-left '#[fg=green](#S) #(whoami)'
# set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
######################
### DESIGN CHANGES ###
######################
# panes
## Status bar design
# status line
# set -g status-justify left
# set -g status-interval 2
# messaging
# set -g message-command-style fg=blue,bg=black
#window mode
# window status
# setw -g window-status-format " #F#I:#W#F "
# setw -g window-status-current-format " #F#I:#W#F "
# setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
# setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
# Info on left (I don't have a session display for now)
# 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
# set -g default-terminal "screen-256color"
# # The modes {
# setw -g clock-mode-colour colour135
# setw -g mode-style bg=colour6,fg=colour0,bold,fg=colour196,bg=colour238
#
# # }
# # The panes {
#
# set -g pane-border-style fg=black,bg=colour235,fg=colour238
# set -g pane-active-border-style fg=brightred,bg=colour236,fg=colour51
#
# # }
# # The statusbar {
#
# set -g status-position bottom
# set -g status-style bg=default,fg=colour12,bg=colour234,fg=colour137,dim
# 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
#
# setw -g window-status-current-style bg=colour0,fg=colour11,dim,fg=colour81,bg=colour238,bold
# setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
# setw -g window-status-style bg=green,fg=black,reverse,fg=colour138,bg=colour235,none
# setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
#
# setw -g window-status-bell-style bold,fg=colour255,bg=colour1
#
# # }
# # The messages {
#
# set -g message-style fg=black,bg=yellow,bold,fg=colour232,bg=colour166
#
# # }
# mouse copy
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
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
bind-key -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # Begin selection in copy mode.
bind-key -T copy-mode-vi 'y' send -X copy-selection # Yank selection in copy mode.
# panes
## Join windows: <prefix> s, <prefix> j
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key k command-prompt -p "send pane to:" "join-pane -t '%%'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'