Colours in nano

I am writing most of my bash script with nano editor. If one want to get colours in nano, on can do:

[bash]
locate *.nanorc
[/bash]

which will give a list of what is available on your system:
/usr/share/nano/html.nanorc
/usr/share/nano/java.nanorc
/usr/share/nano/man.nanorc
/usr/share/nano/mutt.nanorc
/usr/share/nano/nanorc.nanorc
/usr/share/nano/perl.nanorc
/usr/share/nano/python.nanorc
/usr/share/nano/ruby.nanorc
/usr/share/nano/sh.nanorc

Now, you can do:

[bash]
nano -w ~/.nanorc
[/bash]

and add your prefered styling.

Since I am happy with bash, I would add:
include /usr/share/nano/sh.nanorc
to my file.
Read more here:
http://askubuntu.com/questions/90013/how-do-i-enable-syntax-highlighting-in-nano

See blow how it looks like on my computer:

colours in nano

The text below is what I wrote a couple of years ago, but I keep just in case.

 

Some might remember the editor ‘pico’, today most people know it as ‘nano’.

Have you missed sometime to have colour highlighting when editing bash and php scripts with nano? Here are two interesting projects:

https://github.com/craigbarnes/nanorc

and

https://github.com/alekstorm/nanorc

nano editor with colours

Leave a Reply

Your email address will not be published. Required fields are marked *