-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
108 lines (86 loc) · 4.04 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
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'eugene-eeo/tmux-badges'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-yank'
# resurrect and continuum to automatically save and restore tmux sessions in between restarts
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# automatically start tmux when computer starts
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
# automatically restore tmux sessions
set -g @continuum-restore 'on'
set -g @prefix_highlight_output_prefix '< '
set -g @prefix_highlight_output_suffix ' >'
set -g @prefix_highlight_bg colour33
set -g @badge_docker '🐳'
set -g @badge_docker_fg 'colour254'
set -g @badge_docker_bg 'colour33'
set -g @badge_docker_fmt ' #(docker ps --quiet | wc -l | xargs) '
set -g @badge_docker_secondary_bg 'colour241'
# status bar
# fancy shell function simply prefixes a '0' to any single digit cpu percentage - e.g. 05.0% rather than 5.0%.
# this prevents the amount of space taken up by the status bar changing depending on the cpu percentage, since all percentages (excluding 100%) have the same number of digits.
# with docker badge
# set -g status-right '#{prefix_highlight} #{badge_docker} | #{cpu_icon} #(cpu_perc="#{cpu_percentage}"; if [ $( wc -m <<< $cpu_perc ) -le 5 ]; then echo "0$cpu_perc"; else echo $cpu_perc; fi) | %I:%M %p '
# without docker badge
set -g status-right '#{prefix_highlight} #{cpu_icon} #(cpu_perc="#{cpu_percentage}"; if [ $( wc -m <<< $cpu_perc ) -le 5 ]; then echo "0$cpu_perc"; else echo $cpu_perc; fi) | %I:%M %p '
# set scroll history to 100,000 lines
set-option -g history-limit 100000
# modern color support
set -g default-terminal "screen-256color"
# Fix titlebar
set -g set-titles on
set -g set-titles-string "#T"
# shortcut for moving tmux buffer to clipboard
# useful if you've selected with the mouse
bind-key -nr C-y run "tmux show-buffer | xsel -ib"
# Fix titlebar
set -g set-titles on
set -g set-titles-string "#T"
# Mouse friendly
set -g mouse on
# default mode is emacs-mode - use vi-mode instead
set-window-option -g mode-keys vi
# 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"
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
######################
### DESIGN CHANGES ###
######################
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-style fg=colour136,bg=colour235 #yellow and base02
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default #base0 and default
#set-window-option -g window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default #orange and default
#set-window-option -g window-status-current-style bright
# pane border
set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-style fg=colour240 #base01
# message text
set-option -g message-style fg=colour166,bg=colour235 #orange and base02
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red