Jens Segers on Jul 24 2015

OSX Nano Syntax Highlighting

Wait, nano has syntax highlighting? Why did I not know this?


To get it, you will need to install a newer nano version (2.4.2 at the time of writing) using brew:

> brew tap homebrew/dupes
> brew install nano

Syntax highlighting is not enabled by default, and can be turned on by including profiles in your ~/.nanorc file. You can choose to only enable highlighting for specific languages:

include /usr/local/share/nano/html.nanorc
include /usr/local/share/nano/php.nanorc

Or enable them all, which is what I did:

include /usr/local/share/nano/*.nanorc

Hope you find this as useful as I did, enjoy!


Bob 2 months ago

Error in /usr/local/Cellar/nano/2.7.1/share/nano/python.nanorc on line 4: Command "header" not understood

What went wrong?

Muhaimin 1 year ago

this is very helpful...may god bless you