-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
executable file
·103 lines (83 loc) · 3.93 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
################################################################################
# colorscheme & layout
# TODO:
# * terminal specific settings
# * set-hook on client-attached to reload source
# * update-environment to check for current colors
# * if-shell to check against env var values
# * also run nvim update
################################################################################
set-option -g default-shell /bin/zsh
set -g default-terminal "xterm-256color"
# set-option -sa terminal-overrides ",xterm*:Tc"
# set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -g status-left-length 40
set -g status-right-length 60
set status-interval 10
set-option -sg escape-time 10
fg=#c0caf5
blue=#7aa2f7
pane_border=#545c7e
dark_bg=#1f2335
grey_bg=#414868
set-option -ga status-style "fg=$fg,bg=$dark_bg"
set-option -ga pane-border-style "bg=default fg=$pane_border"
set -g status-left "#[bg=$blue,fg=$dark_bg] #S #[bg=$dark_bg,fg=$blue]\uE0B0 "
set -g status-right "#[bg=$dark_bg,fg=$grey_bg]\uE0B2#[bg=$grey_bg,fg=$fg] #{battery_percentage} #{battery_remain} #[bg=$grey_bg,fg=$blue]\uE0B2#[bg=$blue,fg=$dark_bg] %d %h %H:%M "
set -g window-status-current-format "#[fg=$blue,bg=default,bold][#I:#W] \uE0B1"
set -g window-status-format "#I:#W \uE0B1"
# TODO: unset color values above? they're leaking into env vars
set -g popup-border-lines "double"
set -g popup-border-style "fg=$blue"
################################################################################
# input/usability
################################################################################
# leader
# set-option -s prefix C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# panes/windows base 1
set -g base-index 1
setw -g pane-base-index 1
# easy config edit
bind-key M split-window -h "nvim ~/.tmux.conf"
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# always open new pane from current file location
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# swap windows leftward/rightward
bind-key S-Left swap-window -t -1\; select-window -t -1
bind-key S-Right swap-window -t +1\; select-window -t +1
# misc bindings
bind e set -g synchronize-panes # type in all panes simultaneously
################################################################################
# plugins & external
################################################################################
# tmux-resurrect
set -g @resurrect-strategy-nvim 'session' # restore neovim sessions
# tpm plugins
set -g @plugin 'tmux-plugins/tmux-resurrect' # https://github.com/tmux-plugins/tmux-resurrect
set -g @plugin 'tmux-plugins/tmux-battery' # for statusline
run -b '~/.tmux/plugins/tpm/tpm' # must be last
################################################################################
# OLD STUFF -- notes for hooks etc
################################################################################
# # light/dark color scheme switch
# # set-hook -g client-attached 'source-file ~/.tmux.conf; display-message "reloaded tmux conf"'
# set-option -ga update-environment ' DARKMODE'
# set-option -ga update-environment ' BAT_THEME'
# if-shell '[[ "$DARKMODE" -eq 1 ]]' '\
# set-option -ga status-style fg=#c0caf5,bg=#1f2335; \
# set-option -ga pane-border-style "bg=default fg=#586e75"; \
# set -g status-left "#[bg=#7aa2f7,fg=#1f2335] #S "; \
# set -g status-right "#[bg=#7aa2f7,fg=#1f2335] #{battery_percentage} #{battery_remain} | %d %h %H:%M "' '\
# set -g status-left "#[bg=586e75,fg=white] #H @ #S "; \
# set -g status-right "#[bg=#586e75,fg=white] #{battery_percentage} #{battery_remain} | %d %h %H:%M "; \
# set-option -ga status-style fg=white,bg=#586e75; \
# set-option -ga pane-active-border-style fg=#859900; \
# set-option -ga pane-border-style "bg=default fg=#eee8d5"'
#
# # set-hook client-attached 'source-file ~/.tmux.conf; run-shell "update_nvim_bg.sh"'