Bash keyboard shortcuts in iTerm like Alt+d and Alt+f
The Option key (the Mac name for the Alt key) by default has other uses. Press Command+O to open the list of profiles, select Default (I assume that is the profile you are using), and click "Edit Profiles...". In the resulting window, click on the "Keys" tab, and select "+Esc" for one or both option keys. This should cause iTerm to treat the Option key the way you are accustomed.
Alternatively, you can simply use the Escape key instead.
![rewolf](https://i.stack.imgur.com/N9IKE.jpg?s=256&g=1)
rewolf
South African Living in Tokyo Software Engineer too Love snowboarding
Updated on February 12, 2022Comments
-
rewolf over 2 years
Everyone at work recommended iTerm2 to me instead of the native Terminal. But iTerm2 doesn't seem to allow me to use bash shortcuts like Alt+B and Alt+F to jump back/forward between tokens, or Alt+D to delete a word.
I can't imagine this isn't available. Can anyone help me out?
-
rewolf almost 11 yearsThanks this was the config I was looking for. I keep forgetting it's call "Option" as mine says "alt" above it, so I didn't even consider that setting when I skimmed offer the dialogs. I don't want to use Esc, as I'm switching between my mac and a linux box all the time which Esc doesn't work with. Thanks a lot. NOTE to reader. select "Esc+" not "Meta" for the "option" key override.
-
Damien Bezborodow almost 9 yearsBe sure to navigate to "Preferences -> Profiles -> Default -> Keys" instead of "Preferences -> Keys".
-
switz about 5 yearsWell this is fantastic, thank you very much!
-
6005 about 5 yearsCommand O does not open profiles for me. Where do I find this on the latest mac?
-
6005 about 5 yearsAlso using esc-F doesn't work with multiple presses (you have to release and re-press esc each time, which is a bit annoying)
-
6005 about 5 yearsAh I found it -- Terminal > Preferences. (I thought this was a system wide thing so I was looking in system preferences.) I'm glad the remapping is only local to Terminal. See the comments here