Skip to content

Instantly share code, notes, and snippets.

@ToniRib
Last active June 13, 2024 11:20
Show Gist options
  • Save ToniRib/cc96bfa08824eb387410f3956f5e7b7e to your computer and use it in GitHub Desktop.
Save ToniRib/cc96bfa08824eb387410f3956f5e7b7e to your computer and use it in GitHub Desktop.
Get natural keybindings in iTerm

Natual Key Bindings for iTerm

Key References

  • command
  • option/alt
  • left arrow
  • right arrow

Steps

  1. Open iTerm
  2. Open Preferences with ⌘ ,
  3. Click on the Keys tab
  4. Click on the + button at the bottom of the window below the table to add a new key binding
  5. Click on the 'Click to Set' box to record the keys you want to bind
  6. Add the following:

Delete entire line

Keyboard Shortcut: ⌘ delete

Action: Send Hex Code

Argument: 0x15

Delete single word

Keyboard Shortcut: ⌥ delete

Action: Send Hex Code

Argument: 0x17

Jump to beginning of word

Keyboard Shortcut: ⌥ ←

Action: Send Escape Sequence

Argument: b

Jump to end of word

Keyboard Shortcut: ⌥ →

Action: Send Escape Sequence

Argument: f

Jump to beginning of line

Keyboard Shortcut: ⌘ ←

Action: Send Hex Code

Argument: 0x01

Jump to end of line

Keyboard Shortcut: ⌘ →

Action: Send Hex Code

Argument: 0x05

@noaelad
Copy link

noaelad commented Oct 1, 2019

This reaches (I think?) the same result and is a little faster to setup

Preferences -> Profiles -> Keys -> Load Preset... -> Natural Text Editing
image

@ToniRib
Copy link
Author

ToniRib commented Oct 1, 2019

Um, HELL YEAH. I don't know if this just didn't exist when I originally found out how to do this (late 2016, though I obviously didn't make this gist until way later) or if I just didn't know this existed. Thanks, Noa!

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