-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
73 lines (55 loc) · 2.14 KB
/
tmux.conf
File metadata and controls
73 lines (55 loc) · 2.14 KB
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
##
# Configuration
##
# Snappy tmux
set -s escape-time 1
# Make indexing sane
set -g base-index 1
setw -g pane-base-index 1
# Use vim keybindings in copy mode
set -g mode-keys vi
# 256 Colours
set -g default-terminal "screen-256color"
# Source tmuxline config
if-shell "test -f ~/.tmux.d/tmuxline.conf" "source ~/.tmux.d/tmuxline.conf"
# increase repeat time for repeatable commands
set -g repeat-time 1000
# Re-number windows when one is closed
set -g renumber-windows on
# Increase scrollback
set-option -g history-limit 4000
##
# Key Bindings
##
# Rebind prefix
set -g prefix C-a
unbind C-b
# Allow sending of C-a to applications
bind C-a send-prefix
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L || tmux send-keys C-h"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D || tmux send-keys C-j"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U || tmux send-keys C-k"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R || tmux send-keys C-l"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# Bind prefix + r to reload tmux conf
bind r source-file ~/.tmux.conf \; display "Tmux config reloaded!"
# Allow repeats of next/previous window
bind -r n next-window
bind -r p previous-window
# Add some sanity to resizing panes
bind -r Left resize-pane -L 5
bind -r Down resize-pane -D 5
bind -r Up resize-pane -U 5
bind -r Right resize-pane -R 5
# Change new split/window behaviour to something more sensible
unbind c
bind c new-window -c '#{pane_current_path}'
unbind %
bind % split-window -h -c '#{pane_current_path}'
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}'
# Toggle synchronise panes
bind C-s set-window-option synchronize-panes