-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
107 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
# Custom Bindings
## [R]eload
bind-key r source-file ~/.tmux.conf
## Kill current session
bind-key X confirm-before kill-session
## [C]reate window
unbind-key c
bind-key c new-window -c "#{pane_current_path}"
## Show custom bindings
# comm -23 <(tmux list-keys | sort) <(tmux -L test -f /dev/null list-keys | sort)
## Show aliases
# tmux show-options command-alias
# Aliases
## Chat
set -s command-alias[10] chat="command-prompt -p chat: \"run-shell '~/scripts/chat %%%'\""
# OSC 52 Copy/Paste
set -s set-clipboard on
# Vim-ish
## Copy Mode
set -wg mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
## Splits
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Size the window to the smallest client
set -g window-size smallest
# For Whom The Bell Tolls
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -wg monitor-activity off
set -g bell-action none
# Set window name to directory of current pane <https://that.guru/blog/automatically-set-tmux-window-name>
set -g automatic-rename on
set -g automatic-rename-format '#{b:pane_current_path}'
# Satisfy nvim checkhealth <https://github.com/neovim/neovim/wiki/FAQ>
set -sg escape-time 10
set -g focus-events on
# Color Prompt
set -g default-terminal "xterm-256color"
# 1337 Skin
# Also see <https://cassidy.codes/blog/2019-08-03-tmux-colour-theme>
# Also see <https://github.com/arcticicestudio/nord-tmux/blob/develop/src/nord.conf>
## Colors
subtle_black="terminal"
light_black="black"
lighter_black="brightblack"
light_gray="white"
lightest_gray="brightwhite"
light_pink="brightred"
## Components
current_key_table="#{?client_prefix,#[bg=$light_pink] T ,#{?#{==:#{client_key_table},off},#[fg=$light_gray]#[bg=$light_black] O ,#[bg=$light_gray] S }}"
rogues="#(~/scripts/tmux-rogues #S)"
latest_chat="#(~/scripts/chat --read)"
rogues="#(~/scripts/tmux-rogues #S)"
clones="#(~/scripts/tmux-clones #S)"
clients_in_window="#(~/scripts/tmux-clients-in-window #{client_pid} #{window_id})"
time="%a %H:%M:%S"
date="%Y-%m-%d"
set -g pane-border-style fg="$lighter_black"
set -g pane-active-border-style fg="$light_gray"
set -g message-style bg="$lighter_black",fg="$lightest_gray"
set -g status-style bg="$light_black",fg="$lightest_gray"
set -g status-left "#[fg=$light_black]$current_key_table"
set -g status-right "#[fg=$light_gray]$latest_chat #[fg=$lighter_black]$rogues$clones#[fg=$lightest_gray] $time #[fg=$lighter_black]$date "
set -g window-status-current-format "#[fg=$lightest_gray,bg=#{?window_zoomed_flag,$light_pink,$lighter_black}] #I$clients_in_window#W "
set -g window-status-format "#[fg=$lightest_gray,bg=$light_black] #I$clients_in_window#W "
# Nesting <https://www.freecodecamp.org/news/tmux-in-practice-local-and-nested-remote-tmux-sessions-4f7ba5db8795/>
bind -T root F12 {
set prefix None
set key-table off
set status-style "bg="$light_pink",fg="$lightest_gray""
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 window-status-current-style
set -u window-status-current-format
refresh-client -S
}
if-shell -b 'is ssh' {
set status-right "#[fg=$light_gray]$latest_chat #[fg=$lighter_black]$rogues$clones"
}