Making iTerm to translate 'meta-key' in the same way as in other OSes

后端 未结 13 1627
轮回少年
轮回少年 2020-12-12 08:42

In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key

相关标签:
13条回答
  • 2020-12-12 09:09

    Go to Bookmarks > Manage Profiles. Then select Keyboard Profiles > Global and choose Option Key as +ESC.

    Works in iTerm Build 0.9.5.0611 & Build 0.9.6.20090415

    0 讨论(0)
  • 2020-12-12 09:15

    Go to Bookmarks > Manage Profiles. Then select Keyboard Profiles > Global and choose Option Key as Meta. This works for me in version 0.9.6.1201.

    0 讨论(0)
  • 2020-12-12 09:17

    Going all zombie resurrection here, but for sake of posterity --

    This post got it working as you desire for me, for M-b and M-f, while keeping 'Option Key as Meta' set so you don't sacrifice a modifier (I have vim mappings using meta, personally).

    In summary, in your Global Keyboard Profile, add two new mappings with settings:

    1. Key as hex code, value of 62 for b, 66 for f (man ascii)
    2. Modifier as Option
    3. Action as send escape sequence, value b or f

    The only thing I still miss from Terminal.app is Opt-Backspace to delete by word. There are other workarounds for that, but I'm just trying to train myself to use Ctrl-w.

    0 讨论(0)
  • 2020-12-12 09:17

    Go to your iTerm preferences select "profiles" then "key" and change your presets in "Natural Text Editing"

    It should work immediately after.

    It works with iTerm version 3.3.12

    0 讨论(0)
  • 2020-12-12 09:20

    I couldn't get the Alt key working either but there is a workaround that makes it at least function for word navigation via the cursor keys:

    Skip to Next or Previous Word in iTerm Using Alt / Option + Left or Right Arrow Keys

    0 讨论(0)
  • 2020-12-12 09:25

    Cmd+., Profiles, Keys and choose Left option Key acts as: +Esc.

    Works for me in emacs, though I'm not sure if it will have any other undesirable effects.

    0 讨论(0)
提交回复
热议问题