Installing The Newest "nano" Editor With Syntax Highlighting On OS X

You probably already know nano, the simple and easy terminal text editor. It comes pre-installed on most linux and unix systems. However, the version of nano that comes pre-installed with OS X is rather old.

You can easily install the newest version of nano on OS X using HomeBrew. Just note, since nano is in the "dupes" repository, you have to run this command, before you can install nano:

brew tap homebrew/dupes

Then install nano using this command:

brew install nano

Now you have the new version of nano installed in /usr/local/bin.

Next, you have to make sure your PATH, or the global path definition in /etc/paths, has /usr/local/bin before /usr/bin (where the old version of nano resides).

To spice up your new version of nano, you should install syntax highlighting. There is a GitHub project with improved syntax highlighting for nano.

So, if you want great syntax highlighting, all you have to do is clone the repository and run make to generate a concatenated syntax file in ~/.nano/syntax.nanorc.

Then make a nano configuration file ~/.nanorc that includes the syntax file:

include ~/.nano/syntax.nanorc

I wish you happy editing in colour using the newest version of nano on OS X!