-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
190 lines (151 loc) · 4.83 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
# DOCS: https://man7.org/linux/man-pages/man1/tmux.1.html
################
# GENERAL INFO #
################
# CURSOR STYLE
# reset cursor: printf '\033[0 q'
# block cursor: printf '\033[1 q'
# underline cursor: printf '\033[4 q'
# blinking underline cursor: printf '\033[5 q'
# vertical bar cursor: printf '\033[6 q'
# RUN applyt AND <LEADER> + <I> to initially set up
###########
# PLUGINS #
###########
set -g @plugin 'tmux-plugins/tpm'
# https://github.com/tmux-plugins/tmux-resurrect
# SAVE = <LEADER> + <CTRL> + <s>
# RESTORE = <LEADER> + <CTRL> + <r>
set -g @plugin 'tmux-plugins/tmux-resurrect'
# https://github.com/tmux-plugins/tmux-continuum
set -g @plugin 'tmux-plugins/tmux-continuum'
#################
# PLUGIN CONFIG #
#################
# set tmux save interval to 60 minutes
set -g @continuum-save-interval '60'
##########
# COLORS #
##########
set -g @purple "#3e0061"
set -g @pink "#f700e7"
set -g @teal "#66b2b2"
set -g @green "#239400"
set -g @yellow "#dbd400"
set -g @black "#000000"
set -g @light-black "#242424"
set -g @white "#FFFFFF"
###########
# GENERAL #
###########
# refresh status bar every n seconds
set -g status-interval 10
# Start windows and panes at 1, not 0
# you can't 1 index sessions. why? that's a great question.
# https://unix.stackexchange.com/questions/313577/how-to-make-tmux-sessions-count-from-1-instead-of-0
set -g base-index 1
setw -g pane-base-index 1
# for true color support
# https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# mouse mode on. just in case i wanna use it. when it's off selection is weird.
set -g mouse on
# the duration to wait after an escape key press to see if it is part of a key sequence (milliseconds)
set-option -g escape-time 10
# detect focus in a pane
set -g focus-events on
# save more lines of history
set -g history-limit 10000
# use vim keybindings in copy mode
set -g mode-keys vi
# set selection highlight style
set-option -g mode-style "bg=#{@white}","fg=#{@black}"
# use an underscore instead of a block when in copy mode
# this also makes it so that the first block of the selection is always highlighted, which for some reason "block" does not
# set-hook -g after-copy-mode 'set -p cursor-style underline'
###########
# KEYMAPS #
###########
# set ctrl+x to prefix/leader
unbind-key C-b
set-option -g prefix C-x
bind-key C-x send-prefix
# <LEADER>i for session list
unbind s
# [s] only show sessions
# [Z] zoom the pane in to the full window
# [O] sort by field (index, name, time)
bind i choose-tree -swZ -O time
# <LEADER>; for last session
bind-key \; switch-client -l
# <LEADER>q kill current window
bind q killw
# RESIZE PANES
# <LEADER>[arrow keys]
# units for up and down are less than left and right because of typical screen dimensions
bind -r Down resize-pane -D 10
bind -r Up resize-pane -U 10
bind -r Left resize-pane -L 20
bind -r Right resize-pane -R 20
# navigate panes with h j k l (same as vim)
# <LEADER>[h | j | k | l]
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Split panes using | and -
# split into the same directory
# <LEADER>\
# <LEADER>-
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# VIM COPY MODE
# enter copy mode: <LEADER>y
bind 'y' copy-mode
# exit copy mode with <ESC>
bind-key -T copy-mode-vi Escape send-keys -X cancel
# select line: v
# yank selection: y
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
##############
# STATUS BAR #
##############
# max length of side
set -g status-right-length 100
set -g status-style "bg=#{@purple},fg=#{@teal}"
# e.g. '84% • Monday May 27 • 4:34 PM'
set -g status-right "#(~/scripts/bash/battery.sh) • %A %B %-e • %-I:%M %p "
# Show session name and window number on the bottom left
# max length of side
set -g status-left-length 100
set -g status-left " #S • #I/#{session_windows}"
###########
# WINDOWS #
###########
# renumbers windows when one is closed
set -g renumber-windows on
# disable default window status
set -g window-status-format ""
set -g window-status-current-format ""
# always open up new windows in the directory we are currently in
bind c new-window -c "#{pane_current_path}"
#########
# PANES #
#########
# PANE ACTIVE
# borders
set -g pane-active-border-style "fg=#{@yellow}"
# background color
set -g window-active-style "bg=#{@black}"
# PANE INACTIVE
# borders
set -g pane-border-style "fg=#{@teal}"
# background color
set -g window-style "bg=#{@light-black}"
# added this as a failsafe since setting up tpm on new machines sometimes is buggy
setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.tmux/plugins/"
# must stay at bottom of file
# https://github.com/tmux-plugins/tpm
run -b '~/.tmux/plugins/tpm/tpm'