Mac OS X iterm2: backward delete word

Viewed 1962

I've been trying to customize a key shortcut to delete backspace entire word.
I've tried everything online and still this doesn't work.

I'm using iterm2, using Natural Text Editing keys preset and still - doing command + delete will delete the entire line, and doing option + delete will delete the last word up until a certain special character (this could be slash, hyphen, underscore, semicolon, etc...).

Doing control + W gives the same result as option + delete.

I do want the functionality of deleting backwards until a certain special character, but I would also like to be able to delete entire word (until space).

1 Answers

You may add corresponding keybinding to iterm2, or globally:

'Iterm2 preferences -> 'Keys' (or 'Profiles' -> 'Keys' - global | per-profile setting):

  • add desired keyboard shortcut (e.g. option + shift + backspace),
  • add Action - Under 'Send Keystrokes' select 'Send Hex Code' and type '0x17'
Related