-
-
Save BlakeGardner/5587269 to your computer and use it in GitHub Desktop.
# Last updated May, 2024 for Apple silicon Macs | |
# Install Homebrew if you don't already have it: https://brew.sh | |
# install nano from homebrew | |
brew install nano nanorc | |
# update your nanorc file | |
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc | |
# close and re-open your terminal and you'll have syntax highlighting |
Mac OSX Big Sur
nano version:5.8
brew install nano
echo 'include "/opt/homebrew/Cellar/nano/5.8/share/nano/*.nanorc"'>> ~/.nanorc
Thanks @secfb (above), it worked beautifully on an M1 Mac running Monterery & zsh.
I ran:
brew install nano
# Restart terminal
nano -V
# Note the version number
echo 'include "/opt/homebrew/Cellar/nano/NANO_VERSION_NUMBER/share/nano/*.nanorc"'>> ~/.nanorc
# EG: echo 'include "/opt/homebrew/Cellar/nano/5.9/share/nano/*.nanorc"'>> ~/.nanorc
Brew creates symlink so you don't need set nano version number:
echo 'include "/usr/local/share/nano/*.nanorc"' >> ~/.nanorc
or for Apple Silicon: echo 'include "/opt/homebrew/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc
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
or for Apple Silicon: echo 'include "/opt/homebrew/Cellar/nano//share/nano/.nanorc"' >> ~/.nanorc
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!
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
brew install nano
echo include "$(brew --prefix nano)/share/nano/*.nanorc" >> ~/.nanorc
or
brew install nano
brew install nanorc
echo include "$(brew --prefix nanorc)/share/nanorc/*.nanorc" >> ~/.nanorc
latest is:
echo "include /opt/homebrew/Cellar/nano/6.4/share/nano/*.nanorc" >> ~/.nanorc
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
@x86txt: Replace the …/nano/7.0/share/…
part with …/nano/*/share/…
so you don't have to keep updating your .nanorc
file every time nano updates to a newer version.
Worked for me:
brew install nano nanorc
echo 'include "/usr/local/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc
Worked for me:
brew install nano nanorc
echo 'include "/opt/homebrew/share/nanorc/*.nanorc"' >> ~/.nanorc
macOS Ventura 13.2.1
Homebrew 4.0.13
Thanks, updated the gist @s-ota-66
Thanks all for the guide! Can confirm current version is working on 13.3.1
Better to use $(brew --prefix)
to work with both Intel & ARM chips
brew install nano nanorc
echo 'include "'"$(brew --prefix)"'/share/nanorc/*.nanorc"'
echo 'include "/usr/local/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc
Works for Sonora
echo 'include "/usr/local/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc
Probably it would be better to use
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
so in such case it will use the right path depends on if mac uses Intel or Apple Silicon
as of today, may 13th 2024, the following works without issues on sonoma 14.4.1 with and brew 4.2.21:
brew install nano
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
thanks everyone for keeping this going :)
Updated the gist thanks @tobsn
This is nice! It works fine for me. Thank you!