Skip to content

Instantly share code, notes, and snippets.

@ishankhare07
Last active October 18, 2021 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ishankhare07/644a46bf1838097f98c287a07e96b7ad to your computer and use it in GitHub Desktop.
Save ishankhare07/644a46bf1838097f98c287a07e96b7ad to your computer and use it in GitHub Desktop.

Jumping words

To make this work for the right option key, you need to set the key modifier to act as an escape sequence.

First, you need to set your left ⌥ key to act as an escape character.

After that, you can either change the current shortcut for ⌥ ← or create a new one in the profile shortcut keys with the following settings:

Keyboard Shortcut: ⌥←
Action: Send Escape Sequence
Esc+: b

Now we need to repeat a similar process for the ⌥→ keyboard shortcut with the following settings:

Keyboard Shortcut: ⌥→
Action: Send Escape Sequence
Esc+: f

That’s all we need to do. After we are done, we may need to restart the iTerm to be able to use the changes that we just made.

Now we can skip entire words on the command line interface by holding down the left ⌥ key and hitting ← or →.


Delete words and lines

Delete a word - Send Hex Codes - 0x1b 0x08 or 0x17

Delete a line - Send Hex Codes - 0x15


Not tested yet

Go to your iTerm preferences select "profiles" then "key" and change your presets in "Natural Text Editing"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment