You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB
Plaintext

set-option -g default-terminal "screen-256color"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using v and s
bind "s" split-window -c '#{pane_current_path}'
bind "v" split-window -h -c '#{pane_current_path}'
unbind '"'
unbind %
set -s escape-time 0
set-option -gw xterm-keys on
# 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 -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-key -n C-H if-shell "$is_vim" "send-keys C-H" "resize-pane -L"
#bind-key -n C-J if-shell "$is_vim" "send-keys C-J" "resize-pane -D"
#bind-key -n C-K if-shell "$is_vim" "send-keys C-K" "resize-pane -U"
#bind-key -n C-L if-shell "$is_vim" "send-keys C-L" "resize-pane -R"
bind-key -n C-M-h resize-pane -L 1
bind-key -n C-M-j resize-pane -D 1
bind-key -n C-M-k resize-pane -U 1
bind-key -n C-M-l resize-pane -R 1