Syntax highlighting in nano on Mac OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last updated March, 2022 for Apple silicon Macs | |
# Install Homebrew if you don't already have it: https://brew.sh | |
# install nano from homebrew | |
brew install nano | |
# update your nanorc file | |
echo 'include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc | |
# close and re-open your terminal and you'll have syntax highlighting |
Brew creates symlink so you don't need set nano version number:
echo 'include "/usr/local/share/nano/*.nanorc"' >> ~/.nanorc
Thanks @tagplus5, updated the gist for Apple Silicon
This worked for me, brew install nano
and then this command. Thanks! (on M1 MBP)
for me what worked is
echo "include /opt/homebrew/Cellar/nano/6.3/share/nano/*.nanorc" >> ~/.nanorc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! It's weird that you have to encode the wildcard for the version and you don't get a nice symlink like
/usr/local/share/nano/
on Intel Macs. Hopefully there's only one version there at a time!