On Mac, Homebrew (brew
) will allow you to easily upgrade nano to a newer version than the one that came with Mac OSX.
Install brew
, then install a new version of nano
from the Terminal.
brew install nano
Installing this way includes the /usr/local/share/nano
folder containing the default syntax highlight files. See also the extra
subdirectory.
To enable all default syntaxes, add a wildcard include to your ~/.nanorc
.
include "/usr/local/share/nano/*.nanorc"
For Apple Silicon (M1), the path is under /opt/homebrew/
:
include "/opt/homebrew/share/nano/*.nanorc"