-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
96 lines (77 loc) · 2.99 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
#new-session
set-option -g prefix C-a
bind-key C-a last-window
unbind-key C-b
# set-option -g default-terminal "xterm-color"
set-option -g default-terminal "screen-256color"
# send commands to nested tmux sessions
bind-key a send-prefix
# 0 key is waaay over on the right
set-option -g base-index 1
set-window-option -g pane-base-index 1
# make hitting the escape key in vim faster
set-option -sg escape-time 1
# large history
set-option -g history-limit 100000
# reload this file
bind-key r source-file ~/.tmux.conf \; display "tmux.conf reloaded"
# better keys for managing panes
bind-key | split-window -h
bind-key - split-window -v
bind-key Left select-pane -L
bind-key Down select-pane -D
bind-key Up select-pane -U
bind-key Right select-pane -R
bind-key H resize-pane -L 5
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key L resize-pane -R 5
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
set-option -g status-fg white
set-option -g status-bg black
set-option -g status-justify centre
set-option -g status-left "#[fg=green]#S"
set-option -g status-right "#[fg=cyan]%R %Y%m%d"
set-window-option -g window-status-style fg=cyan,bg=default,dim
set-window-option -g window-status-current-style fg=white,bg=red,bright
%if "#{==:#{host_short},magnetic-babysitter}"
set -g status-style bg=red
%elif "#{==:#{host_short},pet-power-plant}"
set -g status-style bg=green
%else
set -g status-style bg=blue
%endif
set-option -g pane-border-style fg=green,bg=black
set-option -g pane-active-border-style fg=white,bg=yellow
set-option -g message-style fg=white,bg=black,bright
# show the current window differently in the status bar
# set-window-option -g window-status-current-attr reverse
# show windows with activity the same way
set-window-option -g monitor-activity on
set-window-option -g visual-activity on
# use the mouse
set-option -g mouse on
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-'\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# fake Esc key for iPad
# bind-key -n ` send-keys Escape
# unbind-key -n `
# List of plugins
#set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @resurrect-processes 'ssh'
#set -g @plugin 'tmux-plugins/tmux-yank'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
#run '~/.tmux/plugins/tpm/tpm'