How do I edit keyboard shortcuts in Nano?
If you install a more up-to-date version of nano, it has improved keyboard navigation. In nano 2.7, the move word shortcut is ctrl+left/right. So you might not even need to do keybindings if you are satisfied with ctrl instead of alt.


Install homebrew: https://brew.sh/
Install nano: brew install nano


If you really want alt, then keep reading.


If using Mac Terminal, you will need to enable the Use Option as Meta key setting. Otherwise the alt key won't work.
/etc/nanorc might be ignored, depending on the flags when your nano was compiled. You can use ~/.nanorc instead, that will work for sure.
Add these lines to ~/.nanorc. (It seems that nanorc does not allow left/right arrows for keybindings, so I chose , and . since they are the same keys as &lt; and &gt;.

bind M-, prevword main
bind M-. nextword main



Now alt+, and alt+. will move to prev/next words.

You can find the full list of commands here: https://www.nano-editor.org/dist/v2.7/nanorc.5.html#REBINDING%20KEYS . (You may want to find the exact version of your nano if not v2.7).