blob: 60602d6c90f2452c28b4de2c096a9d2a9716f33b (
plain)
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
|
set -g default-terminal "screen-256color"
# Remove nasty escape time
set -sg escape-time 0
# Enable mouse scroll
setw -g mouse on
# Use C-a as prefix
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
# Copy
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'nbind %
# Vi mode
set-window-option -g mode-keys vi
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?|vifm)(diff)?$"'
bind -r left if-shell "$is_vim" "send-keys C-h" "run-shell 'tmux_sys_win_aware_navigation.sh left && tmux rename-window #{pane_current_command}'"
bind -r down if-shell "$is_vim" "send-keys C-j" "run-shell 'tmux_sys_win_aware_navigation.sh down && tmux rename-window #{pane_current_command}'"
bind -r up if-shell "$is_vim" "send-keys C-k" "run-shell 'tmux_sys_win_aware_navigation.sh up && tmux rename-window #{pane_current_command}'"
bind -r right if-shell "$is_vim" "send-keys C-l" "run-shell 'tmux_sys_win_aware_navigation.sh right && tmux rename-window #{pane_current_command}'"
# Plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize Tmux Plugin Manager
run '~/.tmux/plugins/tpm/tpm'
|