fix ctrl+arrows in tmux+vim

This commit is contained in:
Connor Olding 2019-07-29 02:53:45 -07:00
parent 9f3d4ef0ef
commit d07adaf621
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,9 @@ bind C-Space send-prefix
# this also makes hitting Enter exit copy-mode, which is a godsend
setw -g mode-keys vi
# need this for ctrl+arrows, etc.
set-option -g xterm-keys on
# remove delay on escape key
set -sg escape-time 0

View File

@ -178,6 +178,15 @@ set backspace=eol,start,indent " make backspace useful
" tab completion in command-line
if has('wildmenu') | set wildmenu | endif
if &term =~ '^tmux'
" https://unix.stackexchange.com/a/34723
" tmux will send xterm-style keys when xterm-keys is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" easy indent/unindent
nn <tab> >>
nn <s-tab> <<