-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
43 lines (33 loc) · 1.18 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
# Set colors
set-option -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Set reload key to r
bind r source-file ~/.tmux.conf
# Count sessions starting at 1
set -g base-index 1
# Use vim bindings
setw -g mode-keys vi
# Use a much bigger scrollback buffer
set-option -g history-limit 50000
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# Use prefix a to toggle binding input to all panes
bind-key a set-window-option synchronize-panes
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind C-l send-keys 'C-l' # Use <prefix> C-l to clear screen
# Remove the annoying delay after hitting escape, (like in vim)
set -sg escape-time 0
set -g mouse on
set -g default-command ${SHELL}