In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key
I use iTerm2, and for me, this answer just partially solved my problem:
Cmd+, => Profiles => Keys and choose Left option Key acts as: +Esc.
In addition to that, I had to go to Cmd+, => Profiles => Keys and in the Key Mappings list find both Key Combinations: and , double click them and change their shortcuts to the following:
*Make sure to select Send Escape Sequence action.