-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
116 lines (92 loc) · 3.45 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
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# set-option -g default-shell "/usr/bin/zsh"
# remap prefix from 'C-b' to 'C-y'
unbind C-b
set-option -g prefix C-y
bind C-y send-prefix
bind -n C-y send-prefix
set -g default-terminal screen-256color
set -g history-limit 10000
set -as terminal-overrides ",*:U8=0"
setw -g mouse off
setw -g monitor-activity off
bind c new-window
bind , command-prompt -I "#{window_name}" "rename-window '%%'"
bind v split-window -h
bind h split-window -v
bind -n M-S-Down resize-pane -D
bind -n M-S-Up resize-pane -U
bind -n M-S-Left resize-pane -L
bind -n M-S-Right resize-pane -R
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Control + Shift arrow to move windows
bind -n C-S-Left swap-window -t -1\; select-window -t -1
bind -n C-S-Right swap-window -t +1\; select-window -t +1
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
unbind r
bind r source-file ~/.tmux.conf\; display-message "Reloaded config..."
# Prefix + P to save buffer to file
bind-key P command-prompt -p 'save buffer to:' -I '#{pane_current_path}/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
# THEME
set -g status-interval 1
set -g status-style bg=blue,fg=black
set -g window-status-format " #I #W "
set -g window-status-current-format " #I #W "
set -g window-status-current-style bg=white,fg=black
set -g status-left-length 15
set -g status-left ' #S '
set -g status-left-style bg=brightgreen,fg=black
set -g status-right-style bg=black
set -g status-right '#(gitmux "#{pane_current_path}")'
# Support for session-in-session
# Press F12 to dark-out the status bar and send all keys directly to the session. This can be used if there's another
# tmux session running inside a window
color_window_off_status_current_bg=color236
color_status_off_text=color238
color_status_current_window_off_text=red
color_window_off_status_bg=black
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_off_text,bg=$color_window_off_status_bg" \;\
set status-left-style "bg=$color_window_off_status_bg,fg=$color_status_off_text" \;\
set window-status-current-style "fg=$color_status_current_window_off_text,bold,bg=$color_window_off_status_current_bg" \;\
set status-right 'OFF' \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
set -u status-left-style \;\
set -u window-status-current-style \;\
set -u status-right \;\
refresh-client -S
bind -T root F11 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_off_text,bg=$color_window_off_status_bg" \;\
set status-left-style "bg=$color_window_off_status_bg,fg=$color_status_off_text" \;\
set window-status-current-style "fg=$color_status_current_window_off_text,bold,bg=$color_window_off_status_current_bg" \;\
set status-right 'OFF' \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F11 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
set -u status-left-style \;\
set -u window-status-current-style \;\
set -u status-right \;\
refresh-client -S