Zionsof
Zionsof

Reputation: 1256

Mac OS X iterm2: backward delete word

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).

Upvotes: 6

Views: 5715

Answers (2)

tejon
tejon

Reputation: 1

I solved this by adding a key mapping for control + backspace to send hex code with sequence 0x1B 0x08

Upvotes: 0

JakeVR
JakeVR

Reputation: 141

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'

Upvotes: 10

Related Questions