-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
134 lines (100 loc) · 4.74 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set -g window-status-style bg=colour235,fg=colour136
set -g default-terminal "screen-256color"
set -as terminal-features ",alacritty*:RGB"
set -g status-bg colour155
# overwrite with bash/ash/fish here
set-option -g default-shell /bin/bash
# set window split
bind-key v split-window -h
bind-key b split-window
# default window title colors
setw -g window-status-format " #I: #W "
set-option -g window-status-style fg=default,bg=default
# active window title colors
# set -g window-status-current-style fg=red,dim,bg=blue,dim
setw -g window-status-current-format "#[fg=white,bold,bright,bg=blue,bright] #I: #W "
# pane border
set -g pane-border-style fg=colour235 #base02
set -g pane-active-border-style fg=colour240 #base01
# message text
set -g message-style fg=colour235,bg=colour166 #base02
# pane number display
set -g display-panes-active-colour colour30 #blue
set -g display-panes-colour colour166 #orange
set -g pane-active-border-style fg=red,bright
# clock
set-window-option -g clock-mode-colour green #green
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Vi copypaste mode
set -g mode-keys vi
# bind-key -T 'v' begin-selection
# bind-key -T 'y' copy-selection
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# rotate panes
bind r swap-pane -D
bind R swap-pane -U
# set to main-horizontal, 60% height for main pane
bind m set-window-option main-pane-height 60\; select-layout main-horizontal
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind u source-file /home/florian/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
set-window-option -g automatic-rename on
# auto window numbering
set-option -g renumber-windows on
# color
# set -g default-terminal "xterm-256color"
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# rm mouse mode fail
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\) -o #{$TMUX_VERSION_MAJOR} -gt 2' 'set -g mouse off'
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off'
# fix pane_current_path on new window and splits
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind c; bind c new-window -c "#{pane_current_path}"'
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'pwittchen/tmux-plugin-ram'
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 40
set -g status-right-length 40
set -g @cpu_low_bg_color "#[bg=colour155]"
set -g status-left '#[fg=black,bright]#(uname -r | cut -c 1-5) • #{cpu_icon} • #{cpu_bg_color} CPU: #{cpu_percentage} • RAM #{ram}'
set -g status-right '#[fg=blue,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=black,bright,bg=default]%a %l:%M:%S %p#[default] #[fg=purple]%Y-%m-%d'
set-option -g update-environment "DIRENV_DIFF DIRENV_DIR DIRENV_WATCHES"
set-environment -gu DIRENV_DIFF
set-environment -gu DIRENV_DIR
set-environment -gu DIRENV_WATCHES
set-environment -gu DIRENV_LAYOUT
# make it so that new panes and windows use current path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
set -g copy-command 'wl-copy'
run '~/.tmux/plugins/tpm/tpm'