-
Star
(195)
You must be signed in to star a gist -
Fork
(29)
You must be signed in to fork a gist
-
-
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 |
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
It took me way too long to notice that the /usr/bin/nano
that comes with macOS is actually "UW PICO 5.09". GNU nano installed via homebrew immediately followed that .nanorc
and applied syntax highlighting. 😄
Worked for me:
macOS Ventura 13.2.1
Homebrew 4.0.13