-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
executable file
·33 lines (26 loc) · 1.03 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
# Use vim colorschemes
set -g default-terminal "screen-256color"
# Set vim bindings
set -g mode-keys vi
# set index for windows
set -g base-index 1
# remove vim escape delay
set -sg escape-time 0
# resizing panes
bind -r H select-pane -l
bind -r J select-pane -D
bind -r K select-pane -U
bind -r L select-pane -R
# copy to system clipboard
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Smart vim/tmux integration
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"
# Split windows
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"