-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
87 lines (69 loc) · 3.16 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
# fix pbcopy and ios sim
# needs brew install reattach-to-user-namespace
set-option -g default-command "reattach-to-user-namespace -l zsh"
# improve colors
set -g default-terminal 'screen-256color'
set-option -g default-shell /bin/zsh
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Copy mode keybindings
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# act like GNU screen
unbind C-b
set -g prefix C-a
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
# soften status bar color from harsh green to light gray
set -g status-bg '#333333'
set -g status-fg '#aaaaaa'
# remove administrative debris (session name, hostname, time) in status bar
set -g status-right '#[bg=red,fg=white]#(cat ~/.remindme)#[bg=colour240,fg=white] #(/Users/david/Android/platform-tools/adb shell dumpsys telephony.registry | egrep "mCallIncomingNumber=[A-Za-z0-9\+]+" | sed "s/mCallIncomingNumber=/ 📞 /")#(/Users/david/Android/platform-tools/adb shell dumpsys battery | grep level | sed "s/level: /🔋 /") #(/usr/bin/battery -o tmux) #[bg=white,fg=colour240] %a %H:%M #[bg=colour240,fg=white] %d %b %Y '
set -g message-attr bold
set -g window-status-format "#[fg=white,bg=coloiur252,bold] #I: #W "
set -g window-status-current-format "#[bg=white,fg=colour240,bold] #I: #W"
# increase scrollback lines
set -g history-limit 50000
# switch to last pane
bind-key C-a last-pane
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# resize bindings
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
# mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# bring back all tmux path behaviour
bind c new-window -c '#{pane_current_path}'
bind "\"" split-window -c '#{pane_current_path}'
bind "\%" split-window -h -c '#{pane_current_path}'
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg '#222222'
set -g pane-active-border-fg green
set -g pane-active-border-bg '#222222'
# plugin manager
set -g @tpm_plugins " \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
"
# initializes TMUX plugin manager
run-shell ~/.tmux/plugins/tpm/tpm