These are keymappings with extra options to travel iTerm2 the same way you would travel a code editor: Using option + arrow to travel words, option delete to delete a word, and command delete to delete a line.
Open Preferences -> Profile -> Keys
and add these:
" ⌥ + ← " - Travel back a word - Send text with Vim characters: \033b
" ⌥ + → " - Travel forward a word - Send text with Vim characters: \033f
" ⌥ + del " - Delete a word - Send hex code: 0x1B 0x08
" ⌘ + del " - Delete line - Send hex code: 0x15
You can open iTerm2, go to Preferences -> Profile -> Keys
, click on import
and import the .itermkeymap
file below