-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
55 lines (40 loc) · 1.85 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
unbind C-b
set -g prefix C-Space
bind r source-file ~/.tmux.conf
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key -t vi-copy C-v rectangle-toggle
bind l select-pane -L
bind h select-pane -R
bind k select-pane -U
bind j select-pane -D
set-option -g default-terminal "screen-256color"
# Use 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
# Allow maximize current pane by double tapping Space
bind Space resize-pane -Z
bind C-Space resize-pane -Z
# Shift-vim keys to switch windows
bind -n S-h previous-window
bind -n S-l next-window
# Syncronize panels
bind 0 setw synchronize-panes
# No delay for escape key press
set -sg escape-time 0
# Highlight current window
set-option -g pane-active-border-fg blue
# 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"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# Start GoTTY in a new window with C-t
bind-key C-t new-window "echo -n 'There you go: http://$NGROK_URL.ngrok.com' | pbcopy; gotty -w tmux attach -t `tmux display -p '#S'`"\; split-window "ngrok 8080"