-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
54 lines (42 loc) · 1.48 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
# More history
set -g history-limit 500000
# Add truecolor support
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# unbind default prefix, and set it to ctrl+g
unbind C-b
set -g prefix C-g
bind C-g send-prefix
# Use default shell
set -g default-command "${SHELL}"
# Pretty status when connected to devserve
set -g status-right "#{s/.facebook.com//:host} • %Y-%m-%d %H:%M"
# Avoid escape delay
set -s escape-time 0
# Vim mode
set -g mode-keys vi
# Mouse friendly
set -g mouse on
# Fast pane actions
bind -n C-q kill-pane
bind "'" split-window -h -c '#{pane_current_path}'
bind \; split-window -v -c '#{pane_current_path}'
# Use hjkl to navigate panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind \\ select-pane -l
# jump to last window with 2x prefix
bind C-g last-window
# Prevent gaps between window numbers
set-option -g renumber-windows on
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key h if-shell "$is_vim" "send-keys C-g h" "select-pane -L"
bind-key j if-shell "$is_vim" "send-keys C-g j" "select-pane -D"
bind-key k if-shell "$is_vim" "send-keys C-g k" "select-pane -U"
bind-key l if-shell "$is_vim" "send-keys C-g l" "select-pane -R"
bind-key \\ if-shell "$is_vim" "send-keys C-g \\" "select-pane -l"