Highlights Python code in nano (editor in terminal)

Many of us who use text managers like Gedit, Kateincluding Notepad + + In Windows, we realize the convenience they provide when writing code.

We write code and it points / highlights the special words, own words of that code (in bash highlights cp, sudo, etc), the problem is that many times we are so deep in the terminal that it is difficult for us to get out of it (minimize it) and open a graphical text editor and be able to enjoy these benefits.

The point is that I will show you how you can make nano (that handy and cool in-terminal text editor) highlight words / code to them Python.

Explained graphically, here are two images, the first is WITHOUT doing anything, and the other is how files will be shown py after following this tutorial:

Cool right? LOL

Achieving this is quite, quite simple:

1. Open a terminal and put the following in it and press [enter]:

cp /usr/share/nano/python.nanorc $HOME/.nanorc

2. ….. NOW!!! Done, nothing else 

Close that terminal and open another one, in it put:

nano test.py

And write what you want, put something in python like «print""import""from»And they will see how these words change and are highlighted.

Greetings 