Bash keyboard shortcuts in iTerm like Alt+d and Alt+f

MacosBashKeyboard ShortcutsItermIterm2

Macos Problem Overview


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?

Macos Solutions


Solution 1 - Macos

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.

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrewolfView Question on Stackoverflow
Solution 1 - MacoschepnerView Answer on Stackoverflow