-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
42 lines (33 loc) · 1.27 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
# set mouse
setw -g mouse on
# making vi mode available (copy mode)
setw -g mode-keys vi
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
# remap prefix binding
unbind C-b
set-option -g prefix C-n
bind-key C-n send-prefix
# remap split bindings
bind ¬ split-window -h
bind ∆ split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes easily (similar to neovim)
#bind h select-pane -L
#bind l select-pane -R
#bind k select-pane -U
#bind j select-pane -D
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# setting escape time
set-option -sg escape-time 10
# setting focus-events
set-option -g focus-events on