문제

With iTerm2 1.0.0 on Mac OS X 10.6.8, I'd like to delete from cursor to the next end of word, i.e. deleting one word forward. I tried Alt+d but this types the delta operator symbol and doesn't delete. How to suppress the typing but let it delete?

도움이 되었습니까?

해결책

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.

다른 팁

PreferencesProfileKeys add the following shortcuts:


Send Escape Sequence Esc+ b

Send Escape Sequence Esc+ f

Send Escape Sequence Esc+ [H

Send Escape Sequence Esc+ [F

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

←Delete Send Hex Code 0x1B 0x08

Del→ Send Hex Code 0x0b

Del→ Send Escape Sequence d

Just to add to Alexsander's answer the easiest way to replicate this behaviour is to select the option "Left option key acts as +Esc" in the Preferences->Profiles-> Keys screen.

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 + d.

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

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top