From fe6f520054cc324911505a6c370a7b5cbe2f6d23 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 22 Feb 2014 17:35:41 +0000 Subject: FAQ about xterm-keys in emacs and vim, from Mark Oteiza. --- examples/xterm-keys.vim | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 examples/xterm-keys.vim (limited to 'examples') diff --git a/examples/xterm-keys.vim b/examples/xterm-keys.vim new file mode 100644 index 00000000..907eb110 --- /dev/null +++ b/examples/xterm-keys.vim @@ -0,0 +1,51 @@ +" tmux.vim - Set xterm input codes passed by tmux +" Author: Mark Oteiza +" License: Public domain +" Description: Simple plugin that assigns some xterm(1)-style keys to escape +" sequences passed by tmux when "xterm-keys" is set to "on". Inspired by an +" example given by Chris Johnsen at: +" https://stackoverflow.com/a/15471820 +" +" Documentation: help:xterm-modifier-keys man:tmux(1) + +if exists("g:loaded_tmux") || &cp + finish +endif +let g:loaded_tmux = 1 + +function! s:SetXtermCapabilities() + set ttymouse=sgr + + execute "set =\e[1;*A" + execute "set =\e[1;*B" + execute "set =\e[1;*C" + execute "set =\e[1;*D" + + execute "set =\e[1;*H" + execute "set =\e[1;*F" + + execute "set =\e[2;*~" + execute "set =\e[3;*~" + execute "set =\e[5;*~" + execute "set =\e[6;*~" + + execute "set =\e[1;*P" + execute "set =\e[1;*Q" + execute "set =\e[1;*R" + execute "set =\e[1;*S" + + execute "set =\e[15;*~" + execute "set =\e[17;*~" + execute "set =\e[18;*~" + execute "set =\e[19;*~" + execute "set =\e[20;*~" + execute "set =\e[21;*~" + execute "set =\e[23;*~" + execute "set =\e[24;*~" + + execute "set t_kP=^[[5;*~" + execute "set t_kN=^[[6;*~" +endfunction + +if exists('$TMUX') + call s:SetXtermCapabilities() -- cgit