Delete previous word or path item in Terminal
In pretty much any Cocoa app, option-delete is an incredibly useful shortcut to delete the previous word or path component. If you mess up typing a word, for example, you can start fresh instead of having to use the mouse/trackpad or hit backspace multiple times. For paths, it’s great for when you want to remove a few components from the end of a path.
In Terminal, however, this is not possible by default. You can enable a command in the Edit menu called “Use Option as Meta Key” and it will restore this Cocoa editing behavior.
You can also enable it on a per-theme basis in the Keyboard tab.I find this incredibly useful in quite a few scenarios.
- You make a typo and it’s just quicker to do option-delete and retype the word
- You’re typing a command and you’ve messed up the flags or perhaps the ordering of arguments and you want to redo only part of the command
- You’re typing a path and you realize it’s incorrect. In this case, option-delete becomes a way to go up one level in the hierarchy.
Extra credit
Option-arrow will move forward or backwards one word without deleting.