aboutsummaryrefslogtreecommitdiff
path: root/.config/tmux/tmux.conf
blob: 08fb89b15bd179ba815179e4a5df60a625eacb93 (plain)
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
# set default shell
set -g default-command "${SHELL}"

# set prefix to ctrl+a
set -g prefix C-a
bind C-a send-prefix
unbind C-b

# reload configuration
bind r source-file ~/.config/tmux/tmux.conf \; run "printf '  # Reload tmux configuration\n' | tmux load-buffer - && tmux paste-buffer"

# settings
set -g mouse on
set -g status off
set -g base-index 1
set -g mode-keys vi
set -sg escape-time 1
set -g visual-activity on
setw -g pane-base-index 1
set -g history-limit 10000
setw -g monitor-activity on

# border colours
set -g pane-border-style fg=colour0
set -g pane-active-border-style fg=colour0

# y and p as in vim
unbind p
bind -n M-p paste-buffer
bind -n M-e copy-mode
bind-key -T copy-mode-vi v   send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle          \; send -X begin-selection
bind-key -T copy-mode-vi y   send-keys -X copy-selection-and-cancel \; run "tmux save-buffer - | xsel -i"

# middle mouse paste
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i"
bind -T root MouseDown2Pane run -b "xsel -o | tmux load-buffer - && tmux paste-buffer -s ' '"

# split pane commands
bind | split-window -h
bind - split-window -v

# alt vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R

# alt arrow keys without prefix key to switch panes
bind -n M-Down  select-pane -D
bind -n M-Left  select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up    select-pane -U

# alt vim keys without prefix to resize panes
bind -n M-H resize-pane -L 5
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-L resize-pane -R 5