-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
89 lines (76 loc) · 4.31 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
cfg_active=$C_THEME2
cfg_inactive=$C_THEME1
cbg_base=$cfg_inactive
cbg_active=''
cbg_inactive=''
set -g prefix2 C-a # preserve tmux default C-b and add another prefix C-a
bind a send-prefix -2 # to preserve some shortcut for readline C-a (C-a a) sends C-a.
bind-key C-a last-window # More screen-like - switch to last window
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded" # Reload config
set -g set-titles on # update terminal window title as tmux window title
set -g set-titles-string "#T" # set term-window title to tmux-window title
set -gs escape-time 0 # for faster switching from INSERT mode to NORMAL in vim
set-option -g history-limit 10000
set-option -g status-position top # show status on top, being consistent with neomutt settings + with new session/window I see what I need on top
# the prompt and the status bar
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION GPG_AGENT_INFO"
set -g default-terminal "tmux-direct" # force tmux TERM
set-option -ga terminal-overrides ",*-direct*:Tc" # true color
# general binding {{{
bind-key k confirm kill-window # Kill window 'C-a k'
bind-key K confirm kill-server # Kill session 'C-a K'
#}}}
# Panes binding and config{{{
bind s split-window -v # split pane vertical
bind v split-window -h # split pane horizontal
bind b set-window-option synchronize-panes # start pane broadcast in the current window
bind-key -r h select-pane -L # select left pane
bind-key -r j select-pane -D # select down pane
bind-key -r k select-pane -U # select up pane
bind-key -r l select-pane -R # select right pane
bind-key -r C-j resize-pane -D 5 # resize pane down
bind-key -r C-k resize-pane -U 5 # resize pane up
bind-key -r C-h resize-pane -L 5 # resize pane left
bind-key -r C-l resize-pane -R 5 # resize pane right
set-option -g pane-active-border-style "fg=$cfg_active,bold" # pane border color - active
set-option -g pane-border-style "fg=$cfg_inactive" # pane border color - inactive
set -g pane-border-status top # pane border status on top
set -g pane-border-format "#[reverse] #P: #T #[none] " # display command name on the top of the pane
#}}}
# windows, status settings {{{
set -g window-status-format "#[fg=#000000]#[bg=$cfg_inactive] #I:#T#[fg=#ff0000]#[bold]#F#{?pane_synchronized,B,}#[fg=$cfg_inactive]#[bg=#000000]"
set -g window-status-current-format "#[fg=#000000]#[bg=$cfg_active] #I:#T#[fg=#ff0000]#[bold]#F#{?pane_synchronized,B,}#[fg=$cfg_active]#[bg=#000000]"
set-option -g renumber-windows on # renumber windows if one is closed
setw -g mode-keys vi # key bindings for copy mode
setw -g pane-base-index 1 # number panes starting from 1; I'm human, not a computer
setw -g base-index 1 # number panes starting from 1; I'm human, not a computer
setw -g monitor-activity on # use hash as flag for recent activity in the window
setw -g window-status-current-style 'fg=default,bg=default,bold' # status bar current window
setw -g window-status-style 'fg=cyan,bg=default,none' # status bar other window
setw -g window-status-bell-style none # status bar window bell attr
setw -g window-status-activity-style none # status bar window activity attr
#}}}
# Status {{{
set -g status-interval 60
set -g status-left-length 40
set -g status-right-length 90
set-option -g status-style 'fg=white,bg=#00ff00,default' # IDK what this is
set -g status-left "#[bg=$cfg_inactive]#[fg=#000000]#[bold] #h #S #P #[nobold]#[reverse] "
set -g status-right "#[bg=#000000]#[fg=$cfg_inactive]#[reverse] #(cat /tmp/neomutt_latest_sync) #(pgrep -qf gmi && /bin/echo '🔄') #(ip addr show|grep -v 127.0.0|awk '/inet /{gsub(/\\/.*/,_,\$2);print \$2 \" \"}'|sort -g -t .|head -n 5|tr -d '\n')#(curl --connect-timeout 5 --max-time 10 -m 2 -4 -Ns l2.io/ip) "
#}}}
# Mouse {{{
# Toggle mouse on with bind-key m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with bind-key M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
#}}}
# Plugins {{{
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sidebar'
run '~/.tmux/plugins/tpm/tpm'
#}}}
# vim:ft=conf:foldmethod=marker:foldlevel=0