-
Notifications
You must be signed in to change notification settings - Fork 11
/
tmux.conf
75 lines (66 loc) · 2.41 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
# ~/.tmux.conf
# Note: Keybindings in here with "C-" such as "C-q" indicate that you should
# press "Control" along with the second character (that is Ctrl-q in the
# example)
# Tmux will let you multiplex your terminal - multiple windows and panes in
# a single SSH session. It will also persist when your network connection
# to a PCDS host goes down.
#
# To start tmux:
# $ tmux
# To reattach to an existing session:
# $ tmux attach
# Multiple sessions are possible.
# -> To list running sessions while in tmux, type C-q s
# -> Start a new session with just "tmux"
# To interact with tmux, use C-q
set -g prefix C-q
# Split windows vertically with C-q v (or C-q c-v)
bind v split-window -h
bind C-v split-window -h
# Split windows horizontally with C-q b (or C-q c-b)
bind b split-window -v
bind C-b split-window -v
# Go between windows with C-q n (next) or C-q p (previous)
bind p previous-window
bind n next-window
# Vim-like pane switching.
# Pane above: C-q k
bind -r k select-pane -U
bind -r C-k select-pane -U
# Pane below: C-q j
bind -r j select-pane -D
bind -r C-j select-pane -D
# Pane left: C-q h
bind -r h select-pane -L
bind -r C-h select-pane -L
# Pane right: C-q l
bind -r l select-pane -R
bind -r C-l select-pane -R
# For better interaction with vim inside of panes, consider using something
# like the following:
# This is based on vim-tmux-navigator, and you may need a vim plugin for it
# to work fully.
#
# is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
# # C-h - select the pane left
# bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# # C-j - select the pane down
# bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# # C-k - select the pane up
# bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# # C-l - select the pane right
# bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Remap arrow keys (normally pane switch) to be resize,
# which will now be double-mapped with ctrl+arrow
bind -r Up resize-pane -U
bind -r Down resize-pane -D
bind -r Left resize-pane -L
bind -r Right resize-pane -R
# Enable mouse control (tmux > 1.8 will need some changes here)
set-option -g mode-mouse on
set-option -g mouse-resize-pane on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
# Later tmux versions: set -g mouse on