-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
85 lines (72 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
set -g default-shell "/bin/bash"
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
setw -g mode-keys vi
set -g history-limit 32768
setw -g xterm-keys on
set -g set-clipboard external
# Windows
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
setw -g aggressive-resize on
# Smart pane switching with awareness of vim splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "resize-pane -L 10"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "resize-pane -R 10"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "resize-pane -U 5"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "resize-pane -D 5"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
bind-key z if-shell "$is_vim" "resize-pane -Z \; send-keys C-w m \; send-keys C-w =" "resize-pane -Z"
bind C-s set-window-option synchronize-panes
bind p paste-buffer
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi V send-keys -X begin-selection \; send-keys -X select-line
bind -T copy-mode-vi C-v send-keys -X begin-selection \; send-keys -X rectangle-toggle
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind C-b last-window
bind b send-prefix
bind ESCAPE copy-mode
bind r source-file ~/.tmux.conf\; display "TMUX!!!"
bind \ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind C-l send-keys 'C-l'\; clear-history
bind-key -r < swap-window -t -
bind-key -r > swap-window -t +
bind-key @ choose-window 'join-pane -s "%%"'
bind-key h command-prompt -p 'history filename: ' -I '~/history.txt' 'capture-pane -S - ; save-buffer %1; delete-buffer'
# Highlight active window
setw -g window-status-current-bg red
setw -g window-status-current-fg white
setw -g window-status-bg default
setw -g window-status-fg white
# Set pane divider
set -g pane-border-bg default
set -g pane-border-fg white
set -g pane-active-border-bg default
set -g pane-active-border-fg white
# Set message
set -g message-fg black
set -g message-bg colour085
# Set copy-mode
set -g mode-fg black
set -g mode-bg colour085
# Set status bar
set -g status-bg default
set -g status-fg white
set -g status-interval 1
set -g status-left ''
set -g status-right ''
if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux.osx.conf' 'source ~/.tmux.linux.conf'