Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Syntax highlighting in nano on Mac OS
# Last updated March, 2022 for Apple silicon Macs
# Install Homebrew if you don't already have it:
# 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
Copy link

up9cloud commented Sep 18, 2022

brew install nano
echo include "$(brew --prefix nano)/share/nano/*.nanorc" >> ~/.nanorc


brew install nano
brew install nanorc
echo include "$(brew --prefix nanorc)/share/nanorc/*.nanorc" >> ~/.nanorc

Copy link

x86txt commented Nov 8, 2022

latest is:

echo "include /opt/homebrew/Cellar/nano/6.4/share/nano/*.nanorc" >> ~/.nanorc

Copy link

x86txt commented Nov 27, 2022

For macOS Ventura:

brew install nano nanorc

echo "include /opt/homebrew/Cellar/nano/7.0/share/nano/*.nanorc" >> ~/.nanorc

Note you might want to take this opportunity to just start with a clean .nanorc if you've been upgrading nano and nanorc frequently.

mv ~/.nanorc ~/.nanorc.orig && echo "include /opt/homebrew/Cellar/nano/7.0/share/nano/*.nanorc" > ~/.nanorc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment