-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
149 lines (124 loc) · 4.08 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Global settings
set -g history-limit 999999999
set -g mouse on
set-option -g mouse on
set -g base-index 1
set -g pane-base-index 1
set -g wrap-search off
set -g bell-action none
set -g default-terminal "screen-256color"
set -g display-time 2000
# Load emacs key bindings
set -g mode-keys emacs
set-option -gw mode-keys emacs
# Unbind all prefix keys
# unbind -a -T prefix
# unbind -a -T root
# unbind -a -T copy-mode
# unbind -a -T copy-mode-vi
unbind C-b
unbind C-l
# Bind prefix key to Control h
set -g prefix 'C-h'
set -g prefix C-h
# Navigation
bind C-h last-window
# Pane management
bind - split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind = select-layout even-horizontal
bind + select-layout tiled
bind z resize-pane -Z
bind -r K resize-pane -U 3
bind -r J resize-pane -D 3
bind -r H resize-pane -L 3
bind -r L resize-pane -R 3
# Windows
bind c new-window -c "#{pane_current_path}"
bind Tab select-window -t +
bind Btab select-window -t -
bind M-Tab choose-session
bind C kill-window
bind 1 select-window -t 1
bind 2 select-window -t 2
bind 3 select-window -t 3
bind 4 select-window -t 4
bind 5 select-window -t 5
bind 6 select-window -t 6
bind 7 select-window -t 7
bind 8 select-window -t 8
bind 9 select-window -t 9
# Meta commands
## Reload configuration
bind-key r source-file ~/.tmux.conf
# Copy mode binding
bind-key Space copy-mode
## Escape exits copy mode
bind -T copy-mode Escape send-keys -X cancel
## Remove time to trigger escape
set -g escape-time 1
## Key bindings for copy mode
bind -T copy-mode Escape send -X cancel
bind -T copy-mode Up send -X cursor-up
bind -T copy-mode Down send -X cursor-down
bind -T copy-mode Left send -X cursor-left
bind -T copy-mode Right send -X cursor-right
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left-length 60
set -g status-right-length 60
set-window-option -g window-status-current-style bg=red
## Right
# set -g status-right '#[fg=yellow]#(uptime | cut -d ',' -f 2-)'
set -g status-right "#{weather} | #{network_bandwidth} | #{battery_percentage} |"
# Customise network bandwith plugin
set-option -g @tmux-network-bandwidth-padding 8
## Left
# source: https://github.com/thewtex/tmux-mem-cpu-load
# install with: brew install tmux-mem-cpu-load
set -g status-interval 2
set -g status-left "#[fg=green]#(tmux-mem-cpu-load --colors --powerline-left --interval 2 --averages-count 1 --graph-lines 6)#[default]"
# Customise weather plugin
set-option -g @tmux-weather-location "Bracknell, UK"
## Monitors activity
setw -g monitor-activity on
set -g visual-activity on
bind-key l send-prefix
# Mouse support
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Automatically renumber windows
set-option -g renumber-windows on
# Restore key bindings
bind ? list-keys -N
# easier and faster switching between next/prev window
bind C-p previous-window
bind C-n next-window
# rename window with current dir
set -g status-interval 1
set -g allow-rename on
set -g automatic-rename on
set -g automatic-rename-format '#{b:pane_current_path}'
# source .tmux.conf as suggested in `man tmux`
bind R source-file ~/.tmux.conf \; display "Config reloaded"
# Plugins
## Install with Ctrl-l + I
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'xamut/tmux-network-bandwidth'
set -g @plugin 'xamut/tmux-weather'
set -g @plugin 'tmux-plugins/tmux-battery'
# source: https://github.com/thewtex/tmux-mem-cpu-load
# install with: brew install tmux-mem-cpu-load
# set -g @plugin 'thewtex/tmux-mem-cpu-load'
## Restore environment
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set -g @resurrect-processes ':all:'
run '~/.tmux/plugins/tpm/tpm'
new-session -n $HOS