Ubuntu Server: Enable Nano Syntax Highlighting CodeUnit 27 NOV 2010

Although newer versions of Ubuntu (10.04 and up) already come with the helpful nano syntax highlighting enabled, older versions don’t – though thankfully switching this on is pretty simple to achieve.

To enable nano syntax highlighting for a user, first copy the nanorc file to the users home directory:

cp /etc/nanorc ~/.nanorc

Next, edit the file, scrolling down to the bottom of the file and uncommenting the lines for the languages you wish to turn syntax highlighting on for.

nano ~/.nanorc

Save your changes and fire up nano against a file with a recognised language extension to see the colorful result.

Easy peasy :)

Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.