-
Notifications
You must be signed in to change notification settings - Fork 77
/
.tmux.conf
47 lines (36 loc) · 1.41 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
set -g default-shell $SHELL
set -g status-bg black
set -g status-fg white
set -g default-terminal "screen-256color"
set -g focus-events on
# window numbering starts at 1
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g aggressive-resize
set -g mouse on
# copy and paste
setw -g mode-keys vi
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi y send -X copy-selection
bind-key -Tcopy-mode-vi Enter send -X copy-selection
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send -X stop-dragging-selection
# split
bind | split-window -h
bind \\ split-window -v
# resize panes like vim
bind -r < resize-pane -L 10
bind -r > resize-pane -R 10
bind -r - resize-pane -D 10
bind -r + resize-pane -U 10
bind y set-window-option synchronize-panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
if-shell '[ -n "$(command -v reattach-to-user-namespace)" ]' \
'set -g default-command "reattach-to-user-namespace ${SHELL}"'
if-shell '[ -n "$(command -v reattach-to-user-namespace)" ] && [ "$TERM_PROGRAM" = "Apple_Terminal" ]' \
'bind-key -Tcopy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy"; \
bind-key -Tcopy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"; \
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe "reattach-to-user-namespace pbcopy"'