-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
90 lines (72 loc) · 3.33 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
set -g default-terminal "screen-256color"
# vim-like pane resizing
bind -r C-k resize-pane -U
bind -r C-j resize-pane -D
bind -r C-h resize-pane -L
bind -r C-l resize-pane -R
# vim-like pane switching
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# and now unbind keys
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind-key M split-window -h "vim ~/.tmux.conf"
# Smart pane switching with awareness of Vim splits. ( See: https://github.com/christoomey/vim-tmux-navigator )
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
set-option -sg escape-time 10
#set-option -g status-style fg=white,bg=black
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# setw -g mouse on
# plugins
set -s default-terminal 'tmux-256color'
set-option -g default-shell "/bin/bash"
set-option -g history-limit 50000
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'christoomey/vim-tmux-navigator'
#run '~/.tmux/plugins/tpm/tpm'
set -g @cpu_percentage_format "%5.2f%%" # Add left padding
set -g @cpu_low_fg_color "#[fg=#00ff00]"
set -g @cpu_percentage_format "%5.1f%%" # Add left padding
# Gruvbox colors
#set-option -g status-bg colour235 # dark gray background
#set-option -g status-fg colour223 # light text
set-option -g status-left-length 50
set-option -g status-right-length 150
# Active window title colors
#set-window-option -g window-status-current-bg colour208 # orange
#set-window-option -g window-status-current-fg colour223 # light text
# #{ram_icon} - will display a RAM status icon
# #{ram_percentage} - will show RAM percentage (averaged across cores)
# #{ram_bg_color} - will change the background color based on the RAM percentage
# #{ram_fg_color} - will change the foreground color based on the RAM percentage
set -g status-right-length 180
# Gruvbox colors
set -g window-status-current-style bg=colour208,fg=colour223
# Configure the status bar with dynamic coloring
set -g status-right "CPU #{cpu_icon} #{cpu_percentage} | RAM #{ram_icon} #{ram_percentage} | GPU #{gpu_icon} #{gpu_percentage} | GRAM #{gram_icon} #{gram_percentage} | %a %h-%d %H:%M"
run-shell ~/clone/path/cpu.tmux
# best shortcuts: choose-tree -s -> <prefix>s
# list shortcuts -> <prefix>?