Yep, works perfectly.  Thanks for this -- I missed this.  Much appreciated.


On Wed, Apr 10, 2013 at 6:45 AM, Ashwin G <tuxdude.git...@gmail.com> wrote:

> Vim understands the xterm style key sequences when the TERM variable is
> set to xterm*. But since tmux sets it to screen instead, vim fails to
> recognize these keys. But this is easily fixable (and should be documented
> in the man page if not already done IMO).
>
> First, you need to enable the xterm-keys option using:
>
> setw -g xterm-keys on
>
> Add the following snippet within your .vimrc so that vim recognizes these
> xterm style key sequences
>
> if &term =~ '^screen' && exists('$TMUX')
>     " Mouse mode
>     set mouse+=a
>     set ttymouse=xterm2
>
>     " tmux sends xterm-style keys when 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"
>     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;*~"
> endif
>
>
> On Tue, Apr 9, 2013 at 10:53 AM, David Niedzielski <
> david.niedziel...@gmail.com> wrote:
>
>>  The default VIM key sequence to navigate to the previous/next tab is
>> C-PageUp and C-PageDown, respectively. It appears that these sequences do
>> not work under either tmux 1.5 or 1.6, and I've tried under Centos as well
>> as Ubuntu. I tried unbinding the sequence in my .tmux.conf, but that had no
>> effect.
>>
>> Easy enough to recreate:
>>
>>    1. Start a tmux session
>>    2. vim xxx.dat
>>    3. :tabnew yyy.dat
>>    4. Try to alternate tabs with C-PageUp/C-PageDown. Nada
>>
>> Repeat steps 2-4 outside of tmux and the tab switching works as it should.
>>
>> Can anyone recreate this behaviour?
>>
>> Thanks in advance...
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> _______________________________________________
>> tmux-users mailing list
>> tmux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tmux-users
>>
>>
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to