38
4

8 に答える 8

55

PreferencesProfileKeys add the following shortcuts:


⌥</kbd>←</kbd> Send Escape Sequence Esc+ b

⌥</kbd>→</kbd> Send Escape Sequence Esc+ f

⌘</kbd>←</kbd> Send Escape Sequence Esc+ [H

⌘</kbd>→</kbd> Send Escape Sequence Esc+ [F

⌘</kbd>←Delete Send Hex Code 0x18 0x7f (add bindkey "^X\\x7f" backward-kill-line to .zshrc if you use zShell)

⌥</kbd>←Delete Send Hex Code 0x1B 0x08

⌘</kbd>Del→</kbd> Send Hex Code 0x0b

⌥</kbd>Del→</kbd> Send Escape Sequence d

于 2016-06-09T07:55:39.317 に答える
34

I don't have a mac handy, but ESC d should in theory do the same thing that ALT-d does.

NOTE: this means hitting ESC, releasing it, then hitting d. Look ma, no key chords.

于 2012-09-09T01:36:23.170 に答える
16

Alexsanderの回答に追加するだけで、この動作を再現する最も簡単な方法は、[設定]->[プロファイル]->[キー]画面で[左のオプションキーは+Escとして機能する]オプションを選択することです。

于 2012-10-24T13:22:18.447 に答える
11

You can add a shortcut for it, go to "Preferences" → "Profiles" → "Keys", and then click on "+" to add a custom shortcut, and add this:

enter image description here

Now you should be able to delete a word forward by clicking ⌥</kbd> + d.

于 2017-12-28T06:30:16.133 に答える
3

You can follow this article to set up the key binding in iterm2. It works for me. The hex codes for...
Deleting a word: 0x17.
Deleting a line: 0x15.

enter image description here

于 2020-05-19T12:32:58.603 に答える
0

ctrl+d was a forward delete for me in irb and iex in iTerm2. But since I wanted to use the regular del key on the keyboard with the numpad, I looked for something else. And then I found a list of hex codes corresponding to ctrl+something key strokes: 4 is number and the number is 4. iTerm2 Del key mapping

于 2015-12-01T08:57:00.570 に答える
0

Surprised no-one mentions this one, which works for me:

Settings -> Profiles -> Default (or whatever) -> Keys -> General -> Left Option key: switch from Normal to Esc+.

于 2021-11-08T10:11:57.230 に答える
0

maxbellec answer was really helpful, I'll just add that:

⌘← Send Escape Sequence Esc+ [H

⌘→ Send Escape Sequence Esc+ [F

did not do the trick for me. First, these shortcuts were already configured in the Preferences -> Keys -> Key Bindings as other actions shortcut (next/previous tab). But changing these shortcuts to other combinations also did not work. So, I've added:

bindkey "^[[F" end-of-line

bindkey "^[[H" beginning-of-line

to the .zshrc, which solved it.

于 2021-12-05T14:02:38.633 に答える