-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorig.tmux.conf
182 lines (142 loc) · 5.3 KB
/
orig.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
# Basic config
# ---------------------------------------------------------------
# Setup path for `run` commands
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"
if "[[ $TERM_PROGRAM == Apple_Terminal ]]" "set -g default-command \"exec reattach-to-user-namespace -l $SHELL\""
# Enable focus events for supporting terminals
set -g focus-events on
# Don't let apps change the window name
set -g allow-rename off
# Make the scrollback buffer huge
set -g history-limit 50000
# Make the repeat time a bit longer; this works best when the repeating command
# involves CTRL so that releasing CTRL ends the repetition
set -g repeat-time 1000
# Enable custom cursor support
# set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# Enable dim mode in Terminal.app (disabled because the esc char prints)
# set -ga terminal-overrides ',*:dim=\E[2m'
# Lower escape timing for quicker response to scroll-buffer access
set -gs escape-time 0
# Keep transient things around longer
set -g display-time 4000
set -g display-panes-time 4000
# Allow tmux to process hex codes sent by iTerm
set -g assume-paste-time 0
# Copy current value of TERM_PROGRAM into environment
set -ga update-environment ' TERM_PROGRAM'
# Key bindings
# ---------------------------------------------------------------
# Vi bindings for everything
set -g status-keys vi
set -g mode-keys vi
# Change the prefix to C-s
unbind-key C-b
set -g prefix C-s
# Unbind all the arrow keys since we're using vi bindings
unbind Left
unbind Down
unbind Up
unbind Right
unbind %
unbind '"'
bind s send-prefix
bind t choose-tree
# Reload the config
bind R run -b ' \
tmux source-file ~/.tmux.conf > /dev/null; \
tmux display-message "Sourced .tmux.conf!"'
# Copy and paste
bind p run "reattach-to-user-namespace pbpaste | tmux load-buffer -; tmux paste-buffer"
bind c copy-mode
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Basic navigation
bind -r [ previous-window
bind -r ] next-window
bind -n S-left previous-window
bind -n S-right next-window
# Pane splitting
bind "|" split-window -h -c "#{pane_current_path}"
bind "-" split-window -v -c "#{pane_current_path}"
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind -r Space next-layout
# Ask before killing a window
unbind C-d
bind -n C-d confirm-before -p "kill-pane #P? (y/n)" kill-pane
# Respawn a pane (helpful when executables have moved, as during update_all)
bind r respawn-pane -k
# Window movement
bind -r "<" swap-window -t -1
bind -r ">" swap-window -t +1
# Automatically renumber windows
set -g renumber-windows on
# Create new windows (like Cmd-T to create new tabs)
bind -n C-t new-window -a -c "#{pane_current_path}"
# Mouse mode
set -g mouse on
# Use a fancy screen terminal if we're using a fancy xterm
set -g default-terminal 'tmux'
if "[[ $TERM == xterm-256color* ]]" "set -g default-terminal 'tmux-256color'" ""
# Status bar
# ---------------------------------------------------------------
# Update the status bar every few seconds
set -g status-interval 5
# <host> .... <windows> .... <info>
set -g status-left ' #h '
set -g status-left-length 30
set -g window-status-format ' #{?window_zoomed_flag,* ,}#I:#W '
set -g window-status-current-format ' #{?window_zoomed_flag,* ,}#I:#W '
set -g status-right '%m/%d | %H:%M '
set -g status-justify centre
# statusbar colors
# set -g status-style 'bg=colour14,fg=colour15' # base1 and base3
set -g status-style 'bg=colour8,fg=colour0'
set -g window-status-style 'bg=colour8,fg=colour0'
set -g window-status-current-style 'bg=colour10,fg=colour7'
# window styles
# Use default foreground and background for active window;
# use dimmed background for inactive window
set -g window-style 'bg=colour10'
set -g window-active-style 'bg=colour0'
# pane styles
set -g pane-border-style 'bg=colour10,fg=colour8'
set -g pane-active-border-style 'bg=colour10,fg=colour3'
# message text
set -g message-style 'bg=colour3,fg=colour0'
set -g message-command-style 'bg=colour8,fg=colour0'
# pane number display
set -g display-panes-active-colour colour4 #blue
set -g display-panes-colour colour9 #orange
# clock
set -g clock-mode-colour colour2 #green
# Tmux plugins
# ---------------------------------------------------------------
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$CACHEDIR/tmux/tmux-plugins/"
set -g status-right '#{prefix_highlight}#{battery_icon} #{battery_percentage} | #{continuum_status} | %m/%d | %H:%M '
set -g @batt_discharging_icon '-'
set -g @batt_full_charge_icon '-'
set -g @batt_high_charge_icon '-'
set -g @batt_medium_charge_icon '-'
set -g @batt_low_charge_icon '-'
set -g @batt_charged_icon ' '
set -g @batt_charging_icon '+'
set -g @resurrect-dir "$CACHEDIR/tmux/resurrect"
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-save-shell-history 'on'
set -g @continuum-save-interval '15'
set -g @prefix_highlight_empty_prompt ' '
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
tmux-plugins/tmux-prefix-highlight \
christoomey/vim-tmux-navigator \
'
run $CACHEDIR/tmux/tmux-plugins/tpm/tpm