nano highlighting on the Mac.
Feb. 12th, 2018 09:19 amnano
doesn't come with highlighting on macOS, unless I'm dramatically missing something. So, notes for myself for later:Source links:
* https://stackoverflow.com/questions/9642617/nano-syntax-highlighting-in-mac-os-x-10-7-lion
* https://github.com/scopatz/nanorc
Steps:
- Download a .zip file of the repo here.
- Extract all files from the .zip file.
- In Terminal, run:
mkdir /usr/local/share/nano
- In Terminal, run:
mv ~/Downloads/nanorc-master/*.nanorc /usr/local/share/nano/
- In Terminal, run:
nano ~/.nanorc
- Add a line like this, for whichever language you want:
include "/usr/local/share/nano/python.nanorc"
- Save your file.
- Quit out of Terminal and reopen to use the shininess.
Note: Apparently nano for the Mac doesn't recognize the
header
keyword on line 4 of the .nanorc files. You'll have to comment that out with a #. (For more nerdy shit on that, go here.)