Skip to content

Commit 6d3896e

Browse files
committed
Split tmux and tmate conf files
tmate has been updated to use its own conf
1 parent 7e4d354 commit 6d3896e

File tree

2 files changed

+104
-12
lines changed

2 files changed

+104
-12
lines changed

_tmate.conf

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# select, yank in vi mode
2+
setw -g mode-keys vi
3+
4+
# tmate is a fork of tmux 2.4, so it needs old keybindings
5+
bind-key -t vi-copy v begin-selection
6+
unbind -t vi-copy C-j
7+
8+
# disable mouse
9+
set -g mouse off
10+
11+
# decrease command delay (increases vim responsiveness)
12+
set -sg escape-time 1
13+
14+
# increase repeat time for repeatable commands
15+
set -g repeat-time 1000
16+
17+
# start window index at 1
18+
set -g base-index 1
19+
20+
# start pane index at 1
21+
setw -g pane-base-index 1
22+
23+
# renumber windows when one is closed
24+
set -g renumber-windows on
25+
26+
set -g history-limit 200000
27+
28+
###########################
29+
# Key Bindings
30+
###########################
31+
32+
# tmux prefix
33+
unbind C-b; set -g prefix C-Space
34+
35+
# resize panes
36+
bind -r H resize-pane -L 5
37+
bind -r J resize-pane -D 5
38+
bind -r K resize-pane -U 5
39+
bind -r L resize-pane -R 5
40+
41+
# C-Space to quickly switch between panes
42+
bind C-Space select-pane -t :.+
43+
44+
# @ to join a pane into the current one (opposite: ! to break)
45+
bind-key @ command-prompt -p "create pane from:" "join-pane -s ':%%'"
46+
47+
# r to force a reload of the config file
48+
unbind r
49+
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded"
50+
51+
# Smart pane switching with awareness of vim splits
52+
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
53+
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?)$'"
54+
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
55+
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
56+
57+
###########################
58+
# Status Bar
59+
###########################
60+
61+
set -g status-interval 30
62+
set -g status-left ""
63+
setw -g window-status-format "#I:#W "
64+
setw -g window-status-current-format "#I:#W "
65+
66+
###########################
67+
# Colors
68+
###########################
69+
70+
set -g status-bg colour235
71+
set -g status-fg white
72+
set -g window-status-style bg=colour235,fg=white
73+
set -g window-status-current-style bg=green,fg=black
74+
set -g pane-active-border-style bg=black,fg=green
75+
set -g pane-border-style bg=black,fg=colour235
76+
77+
###########################
78+
# Plugins
79+
###########################
80+
set -g @plugin 'tmux-plugins/tpm'
81+
set -g @plugin 'tmux-plugins/tmux-sensible'
82+
set -g @plugin 'tmux-plugins/tmux-battery'
83+
set -g @batt_icon_charge_tier8 '-'
84+
set -g @batt_icon_charge_tier7 '-'
85+
set -g @batt_icon_charge_tier6 '-'
86+
set -g @batt_icon_charge_tier5 '-'
87+
set -g @batt_icon_charge_tier4 '-'
88+
set -g @batt_icon_charge_tier3 '-'
89+
set -g @batt_icon_charge_tier2 '-'
90+
set -g @batt_icon_charge_tier1 '-'
91+
set -g @batt_icon_status_charged '+'
92+
set -g @batt_icon_status_charging '+'
93+
set -g @batt_icon_status_discharging '-'
94+
set -g @batt_icon_attached '!'
95+
set -g status-right "#{battery_icon}#{battery_percentage} %F %H:%M"
96+
set -g @plugin 'tmux-plugins/tmux-pain-control'
97+
set -g @plugin 'tmux-plugins/tmux-copycat'
98+
set -g @plugin 'tmux-plugins/tmux-open'
99+
100+
set-environment -g PATH '/usr/local/bin:/bin:/usr/bin'
101+
run '~/.tmux/plugins/tpm/tpm'

_tmux.conf

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
# select, yank in vi mode
22
setw -g mode-keys vi
3-
4-
# Copy to clipboard from vi mode
5-
# tmate is a fork of tmux 2.4, so it needs old keybindings.
6-
# TODO: tmate just started using .tmate.conf. When brew tmate starts using it,
7-
# extract the tmate lines into it and remove them here.
8-
if-shell "pstree -p $$ | grep [t]mate" \
9-
'unbind c; bind c new-window -c "#{pane_current_path}"; \
10-
bind-key -t vi-copy v begin-selection; \
11-
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"; \
12-
unbind -t vi-copy C-j; '\
13-
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
14-
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy;"
3+
bind-key -T copy-mode-vi 'v' send -X begin-selection
4+
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy
155

166
# disable mouse
177
set -g mouse off
@@ -104,6 +94,7 @@ set -g @plugin 'tmux-plugins/tmux-battery'
10494
set -g status-right "#{battery_icon}#{battery_percentage} %F %H:%M"
10595
set -g @plugin 'tmux-plugins/tmux-pain-control'
10696
set -g @plugin 'tmux-plugins/tmux-copycat'
97+
set -g @plugin 'tmux-plugins/tmux-open'
10798

10899
set-environment -g PATH '/usr/local/bin:/bin:/usr/bin'
109100
run '~/.tmux/plugins/tpm/tpm'

0 commit comments

Comments
 (0)