Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With iTerm2 on Mac, how to delete forward a word from cursor on command-line?

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?

like image 559
qazwsx Avatar asked Sep 09 '12 01:09

qazwsx


People also ask

How do I delete a whole word in Terminal Mac?

If I use CTRL + W , it deletes the entire command all the way up to the beginning forward slash. This exact same functionality is available on the out-of-the-box Terminal using option + BACKSPACE by using option key as meta key.


1 Answers

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

like image 192
maxbellec Avatar answered Oct 11 '22 15:10

maxbellec