-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
79 lines (73 loc) · 2.31 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
# global
# [C-x C-z] suspend current tmux
# [C-x :] execute tmux command
# [C-x d] detach from session
# session
# [C-x s] switch sessions
# [C-x $] rename session
# [C-x C] create session
# window
# [C-x c] create window
# [C-x C-k] kill current window
# [C-x n] next window
# [C-x b] previous window
# [C-x 3] split window vertically
# [C-x 2] split window horizontally
# [M-n] switch to n-th window
# pane
# [C-x 1] kill other panes
# [C-x k] kill current pane
# global
unbind C-b
set -g prefix C-x
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf sourced"
set -g default-terminal "screen-256color"
set -g history-limit 65535
set -s escape-time 10
set -g base-index 1
set -g renumber-windows on
set -g set-titles on
set -g set-titles-string '#{s/#{HOME}/~/i:pane_current_path}'
set -g status-interval 1
setw -g pane-base-index 1
setw -g automatic-rename off
# copy mode
setw -g mode-keys vi
bind Enter copy-mode
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
if 'command -v xclip > /dev/null 2>&1' 'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"'
unbind p # change to previous window
bind p paste-buffer
if 'command -v xclip > /dev/null 2>&1' 'bind p run "xclip -o | tmux load-buffer - ; tmux paste-buffer"'
bind P choose-buffer
# session
bind C new-session
# window
unbind '"' # split window horizontally
unbind % # split window veritally
bind 2 splitw -v
bind 3 splitw -h
bind C-k confirm-before -p "kill-window #W? (y/n)" kill-window
bind b previous-window
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-6 select-window -t 7
bind-key -n M-6 select-window -t 8
bind-key -n M-6 select-window -t 9
# pane
bind k killp
bind 1 kill-pane -a
# status bar
set -g status-right '%Y/%m/%d %H:%M:%S'
# set -g status-bg colour237
# set -g status-fg colour137
set -g status-style bg=colour237,fg=colour137
setw -g window-status-current-style fg=colour81
# replace $HOME with ~
setw -g window-status-current-format ' #I:#{s/#{HOME}/~/i:pane_current_path}#[fg=magenta]*'
setw -g window-status-format ' #I:#{b:pane_current_path}'