-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtmux.conf
104 lines (78 loc) · 3.45 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
# set prefix to ctrl+a
unbind C-b
set -g prefix C-a
bind a send-prefix
# reload configuration
bind R source-file ~/.tmux.conf \; display 'Reloaded'
set -g default-terminal 'screen-256color'
# support system pasteboard on OS X
set-option -g default-command "$(which reattach-to-user-namespace &> /dev/null && echo reattach-to-user-namespace -l $SHELL || echo exec $SHELL -l)"
# C-a C-c: copy tmux buffer to system pasteboard
# C-a C-v: paste system pasteboard into tmux window
# C-c in copy mode: copy selection to system pasteboard
bind-key C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind-key C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
bind-key -T copy-mode-vi C-c send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Add cursor shape escape sequences for iTerm
# https://github.com/sjl/vitality.vim/issues/8
set-option -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
# Prevent delay when pressing Esc in Vim
set-option -g escape-time 0
# prevent ssh-agent (SSH_AUTH_SOCK) from being overwritten when a pair connects
set -g update-environment ""
# status bar
set-option -g status-style fg=colour15,bg=colour236
set-option -g window-status-activity-style bold
set-option -g pane-border-style fg=colour245
set-option -g pane-active-border-style fg=colour39
set-option -g message-style fg=colour16,bg=colour221,bold
set-option -g status-left '#[bg=colour148]#[fg=colour22] #S #[default]'
set-option -g status-right '#(which _wemux_status &> /dev/null && _wemux_status || wemux status_users) #[fg=colour148]#(date "+%H:%M")#[default] #[bg=colour252]#[fg=colour236] #(whoami)@#h #[default]'
set-option -g status-interval 5
set-option -g status-right-length 60
set -g window-status-format "#[fg=colour240,bg=colour234] #I #[fg=white]#W #[fg=colour240]#F "
set -g window-status-current-format "#[fg=colour16,bg=colour39,bold] #I #W #[fg=colour25]#F "
setw -g monitor-activity on
set -g display-time 1000
# scrollback buffer size increase
set -g history-limit 500000
# jumping to panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# window/pane management
set -g base-index 1
set -g set-titles on
setw -g automatic-rename on
bind w display-panes # display visible indicator of each pane
# pane dividers colors
setw -g pane-border-style fg=white,bg=colour236
setw -g pane-active-border-style fg=yellow,bg=blue
# opening new windows and panes
bind-key c new-window -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# resizing
bind -r < resize-pane -L 3
bind -r > resize-pane -R 3
bind -r + resize-pane -U 1
bind -r - resize-pane -D 1
# C-A C-A to switch windows (like screen)
bind-key C-a last-window
# C-a C-k to close windows
bind C-k confirm-before kill-window
# C-a r to renumber windows
bind r move-window -r \; refresh-client
# reorder windows
bind-key H swap-window -t -1
bind-key L swap-window -t +1
# C-a C-l to clear window
bind-key C-l send-keys -R \; clear-history
# copy/paste more like vim
# C-A [ enters copy mode, C-A ] pastes
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
bind-key -T copy-mode-vi 'Y' send -X copy-end-of-line
bind-key -T copy-mode-vi 'V' send -X select-line