This is a known issue in iTerm2 that when pressing Alt+left/right arrow, you can’t jump words as you do in your text editor.
Here is the key binding you need to setup :
Go to iTerm2 > Preferences > Profiles > Keys
Add a new key binding with the little + icon.
Type your keyboard sequence in the first field, then fill the others like this :
This will simply bind Esc+b(ackward) and Esc+f(orward) to your usual shortcut. It should work immediately, if not, reload iTerm2.