nonethefewer: A heart made out of a motherboard. (geek heart)
2018-02-12 09:19 am

nano highlighting on the Mac.

nano 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:
  1. Download a .zip file of the repo here.

  2. Extract all files from the .zip file.

  3. In Terminal, run: mkdir /usr/local/share/nano

  4. In Terminal, run: mv ~/Downloads/nanorc-master/*.nanorc /usr/local/share/nano/

  5. In Terminal, run: nano ~/.nanorc

  6. Add a line like this, for whichever language you want:
    include "/usr/local/share/nano/python.nanorc"

  7. Save your file.

  8. 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.)