-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
48 lines (39 loc) · 1.55 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
# Fix vim colorscheme
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ',*:Tc'
# Set vi mode in tmux
set-window-option -g mode-keys vi
# Rebind Ctrl-B to Ctrl-A
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Bind split resize
#bind-key -n C-M-j resize-pane -D
#bind-key -n C-M-k resize-pane -U
#bind-key -n C-M-h resize-pane -L
#bind-key -n C-M-l resize-pane -R
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n M-Left if-shell "$is_vim" "send-keys M-Left" "resize-pane -L 10"
bind -n M-Right if-shell "$is_vim" "send-keys M-Right" "resize-pane -R 10"
bind -n M-Up if-shell "$is_vim" "send-keys M-Up" "resize-pane -U 5"
bind -n M-Down if-shell "$is_vim" "send-keys M-Down" "resize-pane -D 6"
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"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Bind split selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Bind configuration reload
bind r source-file ~/.tmux.conf
# Bind split keys
bind-key v split-window -h
bind-key s split-window -v