-
Notifications
You must be signed in to change notification settings - Fork 10
/
active-row.conf
87 lines (68 loc) · 2.54 KB
/
active-row.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
#
# Colors
#
active_window_bg=colour34
inactive_window_bg=colour102
bar_bg=colour237
bar_fg=colour255
#
# General settings
#
set -g default-terminal screen.xterm-256color
set -g status-right ''
set -g status-left ''
set -g history-limit 100000
#
# Configure prefix
#
unbind C-b
set -g prefix C-a
#
# Prefixed commands
#
# Create a new window (Ctrl + A, Ctrl + c)
bind C-c new-window
# Create a new nested tmux (Ctrl + A, Ctrl + s)
bind C-s new-window ~/.tmux.conf.d/nested-tmux/new-tmux \; \
rename-window '' \; \
command-prompt -I "#W" "rename-window -- '%%'"
# Switch to last window (Ctrl + A, Ctrl + A)
bind C-a last-window
# Rename current window (Ctrl + A, A)
bind A rename-window '' \; \
command-prompt -I "#W" "rename-window -- '%%'"
# Enable search mode
bind -T copy-mode -n / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\""
#
# Non-prefixed commands
#
# Go to next window (Alt + Right)
bind -n M-right next
# Go to previous window (Alt + Left)
bind -n M-left prev
# Create new window (Ctrl + t)
bind -n C-t new-window
# Switch to inner tmux (Alt + Up)
bind -n M-up send-keys M-F12
# Switch to outer tmux (Alt + Down)
bind -n M-down source-file ~/.tmux.conf.d/nested-tmux/inactive-row.conf \; \
run-shell 'tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested-tmux/active-row.conf' \; \
run-shell 'tmux -L $TMUX_PARENT set -g window-status-current-style bg=$active_window_bg'
# Handler for becoming active (Alt + F12, don't use directly)
bind -n M-F12 run-shell 'tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested-tmux/inactive-row.conf' \; \
source-file ~/.tmux.conf.d/nested-tmux/active-row.conf \; \
set -g window-status-current-style bg=$active_window_bg
# Handler for closed window: enable outer terminal
set-hook -g client-detached "run-shell 'tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested-tmux/active-row.conf && tmux -L $TMUX_PARENT set -g window-status-current-style bg=$active_window_bg'"
#
# Appearance
#
set -g status-style bg=$bar_bg
setw -g window-status-style fg=$bar_fg
setw -g window-status-current-format ' #I #W '
setw -g window-status-format ' #I #W '
setw -g window-status-current-style bg=$active_window_bg
# If we're the root tmux, unbind M-down
if-shell 'test -z "$TMUX_PARENT"' 'bind -n M-down send-keys ""' ''
# When a new session is created unbind the parent
if-shell 'test -z "$TMUX_PARENT"' '' 'run-shell "tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested-tmux/inactive-row.conf"'