Last active
November 11, 2024 10:29
-
-
Save BlakeGardner/5587269 to your computer and use it in GitHub Desktop.
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 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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
echo 'include "/usr/local/Cellar/nano/*/share/nano/*.nanorc"' >> ~/.nanorc
Works for Sonora