How do you disable VI-like behavior in macOS terminal?
I found a lot of clues here: https://coderwall.com/p/a8uxma/zsh-iterm2-osx-shortcuts
This is what I put in my .zshrc to fix things.
bindkey &quot;\033f&quot; forward-word
bindkey &quot;\033b&quot; backward-word
bindkey &quot;\033[H&quot; beginning-of-line
bindkey &quot;\033[F&quot; end-of-line


Alongside these terminal keyboard settings:

For some reason, the control (^) key modifier can be set, but does not activate the codes in the terminal. So I'm only using option and shift.
I found a similar solution here which mentioned you can see the key codes by running cat. https://stackoverflow.com/questions/12382499/looking-for-altleftarrowkey-solution-in-zsh
Initially I used whatever key codes I wanted. That was a mistake, because even though they worked on my local mac, they didn't work when I SSH-ed into a linux machine. Using less /etc/inputrc on the remote bash I found these existing shortcuts:
# allow the use of the Home/End keys
&quot;\e[1~&quot;: beginning-of-line
&quot;\e[4~&quot;: end-of-line

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
&quot;\e[1;5C&quot;: forward-word
&quot;\e[1;5D&quot;: backward-word
&quot;\e[5C&quot;: forward-word
&quot;\e[5D&quot;: backward-word
&quot;\e\e[C&quot;: forward-word
&quot;\e\e[D&quot;: backward-word

Also, my local bash had different settings. To find those out I used
bash-3.2$ bind -p | grep of-line
&quot;\C-a&quot;: beginning-of-line
&quot;\eOH&quot;: beginning-of-line
&quot;\e[H&quot;: beginning-of-line
&quot;\C-e&quot;: end-of-line
&quot;\eOF&quot;: end-of-line
&quot;\e[F&quot;: end-of-line


Which made me settle on the terminal keyboard settings you see at the top. Because they worked in all 3 settings (local zsh, local bash, remote bash).