Support for nano of CSS, PHP, C / C ++, HTML, Python, etc.

Before yesterday I left them an article explaining, how the text editor in console: dwarf, it could be configured quite simply so that highlight the keywords de Python, which allowed us to edit files py (Python files) more comfortably.

Well, surely they wonder: «And can't you do the same for .CSS .HTML .SH files and others?»
The answer is yes 😀

Here I will show you how to achieve the same for files from CSS, HTML, Perl,HTML, Bash, C, CMake, Ruby, Java, C / C ++, PHP, Python, Tex, and others more 😉

For example, a file .CSS it would look like this:

To achieve this for all the above languages, here are the steps:

1. Open a terminal, in it write the following and press [enter]:
cd $HOME/ && wget https://blog.desdelinux.net/wp-content/uploads/nanorc.nanorc && mv nanorc.nanorc .nanorc

2. Once this and pressed [enter], the terminal will be closed.
3. Open another terminal, and try the following:
nanotest.html

Write commands like: and they will see that they change color 😉

Ready, a tip that at least will help me a lot.
regards


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   oleksis said

    Very useful for sure, since Nano is one of the editors that comes by default in many distros and to edit files the color highlighting in the syntax is very useful. Could we convert Nano as an IDE, with other functionalities for development?

    Greetings and +1 for the post!

    1.    KZKG ^ Gaara <"Linux said

      I don't know haha, we should put autocomplete and several other things haha.

      1.    oleksis said

        Well, lately I am looking for an alternative to an editor in GNU / Linux with the functionalities, ease and productivity of Notepad ++. Except for Emacs which is a good editor but it takes time and memorize many commands and keyboard shortcuts 😀

        Regards!

        1.    elav <° Linux said

          Did you try Komodo-Edit?

          1.    oleksis said

            Thanks for the recommendation +1. Well I have tried it and so far it has surprised me, I hope that over time it will satisfy my needs as a replacement for Notepad ++. Cheers!

  2.   reedyseth said

    It worked for me at 100, can you add it for the conf files and the var logs?

    1.    KZKG ^ Gaara said

      I don't know ... I didn't do this job as such, these default settings actually come with the system.

  3.   st0rmt4il said

    For those who prefer they can use scribes. It is quite simple and does not consume any resources compared to other text editors.

    The new versions of these editors already have automatic highlighting, you just create the file, save it with the extension, for example .py and when you open it again, wuaalaa! .. the difference will be there 😉

    Regards!

  4.   Jose said

    You could also create an empty file with the extension you want and then
    start working with it, touch file.css, touch file.py, touch file.html, etc.
    That way you would have different templates.