-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
85 lines (67 loc) · 2.36 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
# Remap prefix to Control + a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Prevent infuriating ESC delay
# http://superuser.com/a/252717/31909
set -sg escape-time 0
# Force a reload of the config file
unbind r
bind R source-file ~/.tmux.conf
# 256 Colours
set -g default-terminal "screen-256color"
# Copy paste http://jasonwryan.com/blog/2011/06/07/copy-and-paste-in-tmux/
setw -g mode-keys vi
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"bind-key Escape copy-mode; \
bind-key -t vi-copy Escape cancel; \
bind-key p paste-buffer; \
bind-key -t vi-copy v begin-selection; \
bind-key -t vi-copy V select-line; \
bind-key -t vi-copy r rectangle-toggle; \
bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'V' send -X select-line; \
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle; \
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'"
# Rebind split window
bind | split-window -h
bind _ split-window -v
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize panes like vim
bind < resize-pane -L 5
bind > resize-pane -R 5
bind - resize-pane -D 5
bind = resize-pane -U 5
# resize windows to smallest client only when active
setw -g aggressive-resize on
# Window selection
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Renumber windows when one is closed
set-option -g renumber-windows on
# Prevent renaming windows automatically
setw -g automatic-rename off
# Prompt for window name on creation
# http://superuser.com/questions/565464/can-i-set-a-default-title-for-a-tmux-window
bind-key c command-prompt -p "Name of new window: " "new-window -n '%%'"
bind-key r command-prompt -p "New name for window: " "rename-window '%%'"
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
set -g status-interval 1
# Allow mouse interactions
set-option -g -q mouse on
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-yank \
faceleg/tmux-move-window \
'