Browse Source

Make some xterm keys (ctrl/shift + arrows) working with vim inside tmux

Emmanuel Bouthenot 11 years ago
parent
commit
72c40c855a
2 changed files with 10 additions and 0 deletions
  1. 1 0
      .tmux.conf
  2. 9 0
      .vim/vimrc

+ 1 - 0
.tmux.conf

@@ -12,6 +12,7 @@
 # terminal type, history size, env
 #
 set -g default-terminal "screen-256color"
+set -g xterm-keys on
 set -g history-limit 102400
 set -g update-environment "DISPLAY WINDOWID SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
 #set -g terminal-overrides 'xterm*:smcup@:rmcup@'

+ 9 - 0
.vim/vimrc

@@ -11,6 +11,15 @@
 "
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
+"Term settings (under tmux)
+if &term =~ '^screen'
+    "tmux will send xterm-style keys when its xterm-keys option 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
+
 set nocompatible "no vi compatibility
 set history=200 "command history size
 set undolevels=120 "undo levels count