Wednesday, November 8, 2017

Help needed on terminal mappings

I have my terminal (Terminal.app on macOS) configured with the
following mappings:

Shift+Left_arrow \033[1;2D
Shift+Right_arrow \033[1;2C
Alt+Left_arrow \033b
Alt+Right_arrow \033f

The latter two, in particular, allow me to jump between words in
a shell using Alt+arrows.

Besides, in my vimrc, I have the following:

set <s-left>=^[b
set <s-right>=^[f

(^[ is literal Esc). With those, I can use Shift/Alt + arrows to
jump between words in the command line and in buffers.

In Vim's terminal, however, Alt+arrows send ^[1;2C and ^[1;2D, like
Shift+arrows. How can I configure Vim so that Alt+arrows behave the
same as in my shell (i.e., jump between words)?

I have tried:

tmap <a-left> ^[b
tmap <s-left> ^[b

to no avail. If I remove those two lines above from my vimrc, then
Alt+arrows correctly send ^[b and ^[f in Vim's terminal, but I lose
the ability to use Alt+arrows elsewhere.

Thanks,
Life.



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment