Good evening! I write in C / C ++ and sometimes I really don’t want to go into any IDE to write code (especially when I’m solving zadchki). I know that in nano you can plug in the syntax highlighting of many PLs, in the / etc / nanorc file there are mentions of all languages ​​at the end, but the trouble is that in different mana it is said that lines like this:

#include "/usr/share/nano/pov.nanorc" 

Must be uncommented. But the trouble is that they are all uncommented with me, and there is no light anyway!

Please help and tell how and what to do!

  • uncommented the line include "/usr/share/nano/c.nanorc" and it all worked (in this case for with and with ++). Check file availability. Yes, by the way, it is much easier to learn. - KoVadim pm
  • The file exists in a tedious place! I went there with the same nano, but the problem is that I have already uncovered the lines! And syntax highlighting is not! And for the advice at the expense of vim thanks, I'll think about it. But he just somehow saw it - at first glance it turned out to be very scary for me: without Google I wouldn’t even understand how to get out of there and save the file! : D - hamsternik

3 answers 3

Syntax read man nano and man nanorc . In the last a lot of interesting things on your subject. When opening a file for editing, try explicitly setting - --syntax=[PL]

    Thanks to everyone for their help, the problem was VERY EASY to solve - it turns out that it only needed to specify the extension immediately (when creating a file through nano), that is, to use syntax highlighting in C ++, you had to specify the extension of the .cpp file

    • As always, everything turned out to be simpler :) I advise you to pay attention to the GUI editor: sublimetext.com - BiMaWa

    I have never used this nano, but I can assume that in the configuration file where the syntax highlighting line is connected

     #include "/usr/share/nano/c.nanorc" 

    comment character is '#'.

    And you, as a C \ C ++ programmer, think that the include directive should begin as in C ++ with a '#', so do it so that you would

     include "/usr/share/nano/c.nanorc" 

    Perhaps help.

    • Thank you, yes, if you uncomment in the file "nanorc" (by place of residence: / etc / nanorc) a line like "#include" /usr/share/nano/pov.nanorc "", then the backlight of this language becomes available - hamsternik