-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
71 lines (56 loc) · 2.23 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
# improve colors
set -g default-terminal 'screen-256color'
# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# act like GNU screen
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
# Allows for faster key repetition
set -s escape-time 0
setw -g aggressive-resize on
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g automatic-rename off
# soften status bar color from harsh green to light gray
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
# increase scrollback lines
set -g history-limit 100000
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind-key s split-window -v
bind-key v split-window -h
# resize panes like vim
bind-key -r < resize-pane -L 3
bind-key -r > resize-pane -R 3
bind-key -r + resize-pane -U 1
bind-key -r = resize-pane -D 1
# Workaround for accessing macOS pasteboard
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
# set-option -g default-command "if [[ `uname` == 'Darwing' ]]; then reattach-to-user-namespace -l zsh; else zsh; fi"
set-option -g status-interval 1
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"
# shift arrow keys to switch windows
bind-key -n S-Left select-window -t :-
bind-key -n S-Right select-window -t :+
# Allow proper ssh agent forwarding when reattaching
if-shell 'test "$SSH_CONNECTION"' "set -g update-environment 'DISPLAY WINDOWID XAUTHORITY'"
if-shell 'test "$SSH_CONNECTION"' "set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock"
# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 2
set -g status-right "#S #[fg=yellow] %d %b %Y #[fg=white]::#[fg=colour168]%l:%M %p #[fg=white]:: #[fg=green]#(date -u | awk '{print $4}') #[fg=white]"
set -g status-right-length 120