# Enable built-in syntax highlighting include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc" # Non-default settings set historylog # Save the last 100 history searches for later use. # set positionlog # Saves the cursor position between editing sessions. set zap # Allows you to highlight text (CTRL+SHIFT+ARROW) and delete it with backspace. set autoindent # A new line will have the same number of leading spaces as the previous one. # set tabsize 2 # set tabstospaces set afterends # Ctrl+Right moves to end of word instead of beginning. set wordchars "_" # Recognize _ as part of a word. # Fix option+left/right word skipping # https://unix.stackexchange.com/a/392309 unbind M-B all unbind M-F all bind M-B prevword main bind M-F nextword main # Muscle memory adaptations bind ^s writeout main # Ctrl+S for save. bind ^f whereis main # Ctrl+F for search. # bind ^h replace main # Ctrl+H for find/replace. bind ^z undo main # Ctrl+Z for undo. # bind ^y redo main # Ctrl+Y for redo. # bind ^x cut main # Ctrl+X for cut. # bind ^c copy main # Ctrl+C for copy. # bind ^v paste all # Ctrl+V for paste. bind ^/ comment main # Ctrl+/ for (un)commenting current line.