-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtmux.conf
More file actions
150 lines (109 loc) · 3.95 KB
/
Copy pathtmux.conf
File metadata and controls
150 lines (109 loc) · 3.95 KB
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
###########################
# Configuration
###########################
# Config targeted to tmux >= 2.2
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# Required for pi coding agent
set -g extended-keys on
set -g extended-keys-format csi-u
# Enable focus events
set -g focus-events on
# disable mouse
set -g mouse off
# decrease command delay (increases vim responsiveness)
set -sg escape-time 0
# increase repeat time for repeatable commands
set -g repeat-time 1000
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# re-number windows when one is closed
# Only available in version 1.7 or later
set -g renumber-windows on
set-option -g allow-rename off
###########################
# Workmux
###########################
bind a display-popup -h 30 -w 100 -E "workmux dashboard"
set -g window-status-format '#I:#W#{?@workmux_status, #{@workmux_status},}#{?window_flags,#{window_flags}, }'
set -g window-status-current-format '#I:#W#{?@workmux_status, #{@workmux_status},}#{?window_flags,#{window_flags}, }'
# Devmux related bindings (see minibot/devmux)
bind-key v display-popup -E -w 90% -h 75% -T devmux 'devmux dashboard'
###########################
# Key Bindings
###########################
# tmux prefix (ctrl-j)
unbind C-b
set -g prefix C-j
# create 'v' alias for selecting text
bind-key -T copy-mode-vi v send-keys -X begin-selection
# paste
unbind C-p
bind C-p paste-buffer
# window splitting
unbind %
bind | split-window -h -c "#{pane_current_path}"
unbind '"'
bind - split-window -v -c "#{pane_current_path}"
# window creation
bind c new-window -c "#{pane_current_path}"
# window moving between sessions
bind-key -N "Move window to another session" > choose-tree -s "move-window -t '%%'"
bind-key -N "Move window to a new session" < command-prompt -p "new session name:" "run-shell 'tmux new-session -d -s %1 && tmux move-window -k -t %1:1'"
# Session creation
bind-key -N "Create a new session" S command-prompt -p "new session name:" "new-session -s '%%'"
# Workmux go to previous agent
bind Tab run-shell "workmux last-agent"
# resize panes
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
# quickly switch panes
unbind ^J
bind ^J select-pane -t :.+
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
###########################
# Status Bar
###########################
# enable UTF-8 support in status bar (tmux < 2.2)
# set -g status-utf8 on
# set refresh interval for status bar
set -g status-interval 30
# center the status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S #[default]-#[fg=red] #I:#P#[default] >> '
set -g status-right-length 45
# show hostname, date, time, and battery in right status bar
set-option -g status-right '#[fg=red]@ryyppy #[default]| #[fg=green]#H#[default] %m/%d/%y %I:%M\
#[fg=red]#(battery discharging)#[default]#(battery charging)'
###########################
# Colors
###########################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-style "fg=black,bg=green"
# set color of active pane
set -g pane-border-style "fg=colour235,bg=black"
set -g pane-active-border-style "fg=green,bg=black"
if-shell 'test "$(uname)" = "Darwin"' 'source ~/dotfiles/tmux-osx.conf'
if-shell 'test "$(uname)" = "Linux"' 'source ~/dotfiles/tmux-linux.conf'
# Mosh specific hack
# see https://gist.github.com/yudai/95b20e3da66df1b066531997f982b57b
# and ... mosh pr: https://github.com/mobile-shell/mosh/pull/1054
set-option -as terminal-overrides "xterm-256color:Ms=\\E]52;c%p1%.0s;%p2%s\\7"