aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/tmux.conf
blob: 1ddc87716fc55a117123a040219db80ae397717a (plain)
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
new-session                       # Start a new session if none available

# tty
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -sg escape-time 0
set -gw xterm-keys on

# prefix
unbind C-b
set -g prefix C-g

# Tab key
bind-key -nr C-_ send-keys C-/

# status bar
set-window-option -g window-status-current-style fg=black,bg=yellow


bind N new-session
bind-key -n C-F3 set -g status #Ctrl+F3 Combo

bind k copy-mode
bind-key T swap-window -t 0

# config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."

# layout
bind C-q select-layout even-horizontal
bind C-w select-layout even-vertical
bind C-e select-layout main-horizontal
bind C-r select-layout main-vertical

# color
# Feel free to NOT use this variables at all (remove, rename)
# this are named colors, just for convenience
color_orange="colour166" # 208, 166
color_purple="colour134" # 135, 134
color_green="colour076" # 070
color_blue="colour39"
color_yellow="colour220"
color_red="colour160"
color_black="colour232"
color_white="white" # 015

# This is a theme CONTRACT, you are required to define variables below
# Change values, but not remove/rename variables itself
color_dark="$color_black"
color_light="$color_white"
color_session_text="$color_blue"
color_status_text="colour245"
color_main="$color_orange"
color_secondary="$color_purple"
color_level_ok="$color_green"
color_level_warn="$color_yellow"
color_level_stress="$color_red"
color_window_off_indicator="colour088"
color_window_off_status_bg="colour238"
color_window_off_status_current_bg="colour254"

# nested tmux

#bind -T root S-F12  \
#  set prefix None \;\
#  set key-table off \;\
#  set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
#  set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
#  set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
#  if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
#  refresh-client -S \;\

bind -T root F12  \
  set prefix None \;\
  set key-table off \;\
  set status 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 \;\
  refresh-client -S

#wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"

set -g status-right "$wg_is_keys_off #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host"

if-shell "test -f ~/.tmux.conf.local" "source-file ~/.tmux.conf.local"