The branch, master has been updated
       via  2a412fad044e402391a1c82dc600ce03c7ce2bc5 (commit)
       via  fe6f520054cc324911505a6c370a7b5cbe2f6d23 (commit)
      from  b7589750a1df0f34c73aadfa138e0fe5baa57233 (commit)

- Log -----------------------------------------------------------------
commit 2a412fad044e402391a1c82dc600ce03c7ce2bc5
Merge: fe6f520 b758975
Author: Nicholas Marriott <nicholas.marri...@gmail.com>
Commit: Nicholas Marriott <nicholas.marri...@gmail.com>

    Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code

 tmux.1 |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


commit fe6f520054cc324911505a6c370a7b5cbe2f6d23
Author: Nicholas Marriott <nicholas.marri...@gmail.com>
Commit: Nicholas Marriott <nicholas.marri...@gmail.com>

    FAQ about xterm-keys in emacs and vim, from Mark Oteiza.
---
 FAQ                     |   25 +++++++++++++++++++++++
 examples/xterm-keys.vim |   51 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/FAQ b/FAQ
index da72d43..6181ad8 100644
--- a/FAQ
+++ b/FAQ
@@ -238,6 +238,31 @@ would be welcome.
 
 vim users may also want to set the "ttyfast" option inside tmux.
 
+* How do I make ctrl and shift arrow keys work in emacs?
+
+The terminal-init-screen function in term/screen.el is called for new frames,
+but it doesn't configure any function keys.
+
+If the tmux xterm-keys option is on, it is enough to define the same keys as
+xterm. Add the following to init.el or .emacs to do this:
+
+(defadvice terminal-init-screen
+  ;; The advice is named `tmux', and is run before `terminal-init-screen' runs.
+  (before tmux activate)
+  ;; Docstring.  This describes the advice and is made available inside emacs;
+  ;; for example when doing C-h f terminal-init-screen RET
+  "Apply xterm keymap, allowing use of keys passed through tmux."
+  ;; This is the elisp code that is run before `terminal-init-screen'.
+  (if (getenv "TMUX")
+    (let ((map (copy-keymap xterm-function-map)))
+    (set-keymap-parent map (keymap-parent input-decode-map))
+    (set-keymap-parent input-decode-map map))))
+
+And ensure .tmux.conf contains "set -g xterm-keys on".
+
+Alternatively, the screen.el file can be copied to the load path and
+customized.
+
 * Why doesn't elinks set the window title inside tmux?
 
 There isn't a way to detect if a terminal supports setting the window title, so
diff --git a/examples/xterm-keys.vim b/examples/xterm-keys.vim
new file mode 100644
index 0000000..907eb11
--- /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 <xUp>=\e[1;*A"
+  execute "set <xDown>=\e[1;*B"
+  execute "set <xRight>=\e[1;*C"
+  execute "set <xLeft>=\e[1;*D"
+
+  execute "set <xHome>=\e[1;*H"
+  execute "set <xEnd>=\e[1;*F"
+
+  execute "set <Insert>=\e[2;*~"
+  execute "set <Delete>=\e[3;*~"
+  execute "set <PageUp>=\e[5;*~"
+  execute "set <PageDown>=\e[6;*~"
+
+  execute "set <xF1>=\e[1;*P"
+  execute "set <xF2>=\e[1;*Q"
+  execute "set <xF3>=\e[1;*R"
+  execute "set <xF4>=\e[1;*S"
+
+  execute "set <F5>=\e[15;*~"
+  execute "set <F6>=\e[17;*~"
+  execute "set <F7>=\e[18;*~"
+  execute "set <F8>=\e[19;*~"
+  execute "set <F9>=\e[20;*~"
+  execute "set <F10>=\e[21;*~"
+  execute "set <F11>=\e[23;*~"
+  execute "set <F12>=\e[24;*~"
+
+  execute "set t_kP=^[[5;*~"
+  execute "set t_kN=^[[6;*~"
+endfunction
+
+if exists('$TMUX')
+  call s:SetXtermCapabilities()


-----------------------------------------------------------------------

Summary of changes:
 FAQ                     |   25 +++++++++++++++++++++++
 examples/xterm-keys.vim |   51 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100644 examples/xterm-keys.vim


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to