-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
159 lines (124 loc) · 5.55 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
150
151
152
153
154
155
156
157
158
159
# loud or quiet?
setw -g monitor-activity off
set -g visual-activity off
set -g activity-action other
setw -g monitor-bell on
set -g visual-bell on
set -g bell-action other
setw -g monitor-silence 0
set -g visual-silence off
# Options to update SSH_AUTH_SOCK
# set -ag update-environment "SSH_AUTH_SOCK"
set -g update-environment "DISPLAY SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
# Commented-out for macOS when using keychain, since keychain manages the socket
# and trying to set in a file results in some "No such file or directory" error
# set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
## Sensible Options (adapted from https://github.com/tmux-plugins/tmux-sensible)
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# Increase scrollback buffer size
set -g history-limit 50000
# Display tmux messages for 4 seconds
set -g display-time 4000
# Emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs
# use focus events for updating vim etc.
set -g focus-events on
# Upgrade $TERM
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# Start numbering at 1
set -g base-index 1
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
## Key bindings
# C-b is not acceptable -- Vim uses it
# bash uses C-a; so we'll use C-f
set-option -g prefix C-f
# set window split with prompt; for quick 50/50 use % and "
bind-key v command-prompt -I 30 -p "New split proportion:" "split-window -h -l %1%%"
bind-key b command-prompt -I 30 -p "New split proportion:" "split-window -l %1%%"
# easier and faster switching between next/prev window
bind C-p previous-window
bind C-n next-window
# Toggle between two windows with prefix + prefix
bind-key C-f last-window
# Allows us to use C-f f <command> to send commands to a TMUX session inside
# another TMUX session
bind-key f send-prefix
# Switch panes with HJKL
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Vi copypaste mode
set-window-option -g mode-keys vi
# set-clipboard on
# Yank to xclip clipboard; only for tmux -V >= 2.5
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# bind-key -T copy-mode-vi v send-keys -X begin-selection
# bind-key -T copy-mode-vi y send-keys -X copy-selection
if-shell "uname | grep -q Darwin" {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
# set to main-horizontal, 60% height for main pane
bind m set-window-option main-pane-height 60\; select-layout main-horizontal
# bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind r source-file ~/.tmux.conf\; display-message "Config reloaded..."
# update working directory to current pane path
bind u attach-session -c "#{pane_current_path}"\; display-message "Session attached to #{pane_current_path}"
# open a new window in the current directory
bind C new-window -c "#{pane_current_path}"
# auto window rename
set-window-option -g automatic-rename
# status bar
set-option -g status-position top
set-option -g status-justify centre
set -g status-left-length 150
set -g status-right-length 150
set -g status-interval 5
set -g status-left '#{?client_prefix,#[fg=black#,bg=brightred#,fill=brightred],#[fg=black#,bg=green]}'
set -ag status-left " \ufab1 "
set -ag status-left '#{?client_prefix,#[fg=black#,bg=brightred],#[fg=green#,bg=black]}'
set -ag status-left ' #S:p#P'
# set -ag status-left " #{b:session_path}"
set -g status-right "#[fg=black,bg=green,align=right]"
set -ag status-right " "
set -ag status-right "#(TZ=America/Los_Angeles date +'%%Y-%%m-%%d %%H:%%M') PST"
set -ag status-right ' #[reverse,align=right]'
# set -ag status-right " "
set -ag status-right ' #[noreverse,align=right]'
set -ag status-right '#[fg=#777777,bg=black,align=right]'
set -ag status-right "(#(TZ=UTC date -u +%%H:%%M) UTC)"
# setw -g window-status-current-format "#{?window_start_flag, \ufaff,}"
setw -g window-status-current-format " #I:#W"
setw -ag window-status-current-format "#{?window_zoomed_flag, \ueb81,}"
setw -ag window-status-current-format "#{?window_bell_flag, ,}"
# setw -ag window-status-current-format "#{?window_end_flag, \ufb00,} "
setw -ag window-status-current-format " "
setw -g window-status-current-style "fg=black,bg=blue,bright,align=centre"
setw -g window-status-bell-style "fg=black,bg=red,align=centre"
setw -g window-status-activity-style "fg=black,bg=yellow,align=centre"
setw -g window-status-last-style "fg=black,bg=#777777,align=centre"
setw -g window-status-separator ""
set -g message-style "fg=black,bg=yellow"
# colors
set -g status-bg "black"
set -g status-fg "white"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-yank'
# https://sunaku.github.io/tmux-yank-osc52.html
set -g @override_copy_command 'osc52 > #{pane_tty}'
# set -g @plugin 'seebi/tmux-colors-solarized'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'