/
.tmux.conf
123 lines (97 loc) · 3.22 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
# banyan's .tmux.conf file
# Kohei Hasegawa <ameutau@gmail.com>
# https://github.com/banyan/config
# aliases
# set-window-option => setw
# set-option => set
# bind-key => bind
# unbind-key => unbind
# unbind => default key
unbind C-b # => prefix
unbind % # => split-window -h
unbind '"' # => split-window
# command prefix:
set -g prefix ^t
# hack to get pbcopy and pbaste to work on OS X
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/
set -g default-command zsh
# for sierra use: brew install reattach-to-user-namespace --with-wrap-pbcopy-and-pbpaste
# https://stackoverflow.com/a/44819527/225291
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi v send -X begin-selection
bind P run "pbpaste | tmux load-buffer - && tmux paste-buffer"
# http://www.tokoro.me/2013/01/17/tmux-toggle/
bind C-t run "tmux last-pane || tmux last-window || tmux new-window"
# global settings
set -g visual-bell on
set -g bell-action any
set -g history-limit 100000
setw -g automatic-rename off
# split keys
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# move between panes using vi keys 'hjkl'
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes using vi keys 'hjkl'
bind -r C-h resize-pane -L 9
bind -r C-j resize-pane -D 7
bind -r C-k resize-pane -U 7
bind -r C-l resize-pane -R 9
# change layout, and swap from active pane to main pane
bind -r H select-layout main-vertical \; swap-pane -s : -t 0 \; select-pane -t 0 \; resize-pane -R 9
bind -r K select-layout main-horizontal \; swap-pane -s : -t 0 \; select-pane -t 0 \; resize-pane -D 18
# move between tmux sessions (tmux > 1.4)
bind N switch-client -n
bind P switch-client -p
bind L switch-client -l
# aliases for select-layout
bind | select-layout even-horizontal
bind _ select-layout even-vertical
bind S select-layout main-horizontal
bind V select-layout main-vertical
bind * select-layout tiled
# reassign ; from last-pane to last-window
# bind \; last-window
# enable 256 colors
set -g default-terminal "screen-256color"
# vi mode for shortcuts
setw -g mode-keys vi
set -g status-keys vi
# activity
setw -g monitor-activity on
set -g visual-activity on
# start window number from 1
set -g base-index 1
# extend message display time
set -g display-time 2000
# aggressively resize the chosen window
setw -g aggressive-resize on
# colour
setw -g window-status-style bg=colour6,fg=black
setw -g window-status-current-style bg=white,fg=black,bold,underscore
set -g display-panes-colour colour6
set -g message-style bg=white
set -g pane-active-border-style fg=colour6
set -g status-style bg=colour6,fg=black
set -g status-left ''
set -g status-right "[%Y/%m/%d %H:%M]#[default]" # eg: [2011/03/06 20:21]
set -g status-right-length 100
set -g status-right-style bg=colour6,fg=black
set -g status-justify "left"
# compatible key bind with screen
bind C-[ copy-mode
bind C-c new-window -c '#{pane_current_path}'
bind C-n next-window
bind C-p previous-window
bind C-d detach-client
bind Q break-pane
# custom bind key
bind a last-window
# take over current path
unbind-key c
bind c new-window -c "#{pane_current_path}"
# reload tmux.conf
bind r source-file ~/.tmux.conf