/
.tmux.conf
137 lines (95 loc) · 3.3 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
# vim: ft=tmux ts=2 et:
# leader binding
unbind C-b
set -g prefix M-a
# set -g default-shell /usr/local/bin/bash
# required.
# otherwise clipboard copying issues
# also `open .` fails
# set -g default-command "~/.tmux/default-command.sh -l bash"
set-option -g default-command "$HOME/.tmux/default-command.sh"
bind M-a send-prefix
bind-key a send-prefix
# fix wait time for escape (helps with tmux and vim)
set -s escape-time 0
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind L last-window
bind n next-window
bind N previous-window
# start indexing windows from 1, just like tabs
set -g base-index 1
# set -g default-terminal "screen-256color"
# set -g terminal-overrides 'xterm:colors=256'
# setw -g automatic-rename on
# window titles
set -g set-titles on
# display visible indicator of each pane
# bind-key w display-panes
bind-key S source-file $HOME/.tmux.conf; # refresh-client
# swap panes
bind-key -r J swap-pane -D
bind-key -r K swap-pane -U
# copying and pasting
bind-key [ copy-mode
bind-key ] paste-buffer -s \015
# capture-pane -S -32768
# tmux capture-pane -S -32768 -p|pbcopy
# tmux save-buffer -| pbcopy
#
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'
}
# list all paste buffers (default key is '#')
bind-key b list-buffers
# choose buffer to paste interactively (default key was '=')
bind-key p choose-buffer
# delete the most recently copied buffer of text (default key was '-')
bind-key x delete-buffer
# Screen-like key bindings
# new window
bind-key C-c new-window -c "#{pane_current_path}"
bind-key c new-window -c "#{pane_current_path}"
# quit
# bind-key \ confirm-before kill-server
# displays
bind-key * list-clients
# Split windows like vim
# alternatively, use better mnemonics for horizontal/vertical splits
unbind '"'
bind-key _ split-window -v -c "#{pane_current_path}"
unbind '%'
bind-key | split-window -h -c "#{pane_current_path}"
# resize panes like vim
bind-key -r < resize-pane -L 7
bind-key -r > resize-pane -R 7
bind-key -r + resize-pane -U 20
bind-key -r - resize-pane -D 20
# Statusbar settings
# use vi-style key bindings in the status line
set -g status-keys vi
# amount of time for which status line messages and other indicators
# are displayed. time is in milliseconds.
set -g display-time 2000
# default statusbar colors
# set-option -g status-utf8 on
set-option -g status-style fg=colour15,bg=black,none
setw -g window-status-style fg=colour15,bg=black,none
setw -g window-status-current-style fg=black,bg=color15
setw -g window-status-current-format '► #[fg=black]#I#[default] #W#F '
setw -g window-status-format '#[fg=white]#I#[default] #W#F'
# pane dividers colors
setw -g pane-border-style fg=white
setw -g pane-border-style fg=black
setw -g pane-active-border-style fg=yellow,bg=blue
set-option -g status-left '#S# #(whoami)@#H# |'
set-option -g status-right ''
set-option -g status-right-length 1000
set-option -g status-left-length 60