How do I enable syntax highlighting in nano?nano syntax highlighting not working for all languagesWhat IDEs...

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

How much cash can I safely carry into the USA and avoid civil forfeiture?

A Paper Record is What I Hamper

Map of water taps to fill bottles

What is the philosophical significance of speech acts/implicature?

If a planet has 3 moons, is it possible to have triple Full/New Moons at once?

Is Diceware more secure than a long passphrase?

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

Providing evidence of Consent of Parents for Marriage by minor in England in early 1800s?

Get consecutive integer number ranges from list of int

Is there really no use for MD5 anymore?

What's the polite way to say "I need to urinate"?

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

What's the name of these pliers?

Elements other than carbon that can form many different compounds by bonding to themselves?

On The Origin of Dissonant Chords

What is causing the white spot to appear in some of my pictures

What happened to Captain America in Endgame?

Was there a shared-world project before "Thieves World"?

Does Gita support doctrine of eternal samsara?

Can someone publish a story that happened to you?

Two field separators (colon and space) in awk

Is it idiomatic to construct against `this`

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?



How do I enable syntax highlighting in nano?


nano syntax highlighting not working for all languagesWhat IDEs are available for Ubuntu?Difference between Nano and VimWhat editor can I use as a simple vi/vim alternative?How can I enable syntax highlighting in a Python file without an extension?syntax highlighting with less, trouble with lexernano editor now B/WHow do I enable a linter in nanoNano syntax highlighting for C# and/or ASP.NetNano Syntax Highlighting Colorsnano syntax highlighting not working for all languagesHow to set nano default syntax highlighting for files with no extension?How can I enable syntax highlighting in a Python file without an extension?How do I get terminator to use syntax highlighting?Nano not highlighting syntax anymorevim syntax highlighting ubuntu touchSwift syntax highlighting in gedit?Syntax Highlighting vi editor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







171















Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.










share|improve this question




















  • 1





    Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

    – user326219
    Sep 12 '14 at 15:23






  • 1





    @TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

    – Oxwivi
    Sep 15 '14 at 11:45


















171















Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.










share|improve this question




















  • 1





    Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

    – user326219
    Sep 12 '14 at 15:23






  • 1





    @TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

    – Oxwivi
    Sep 15 '14 at 11:45














171












171








171


79






Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.










share|improve this question
















Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.







nano syntax-highlighting






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 2 '13 at 19:51









Jorge Castro

37.4k107423618




37.4k107423618










asked Dec 23 '11 at 15:20









OxwiviOxwivi

4,65243118184




4,65243118184








  • 1





    Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

    – user326219
    Sep 12 '14 at 15:23






  • 1





    @TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

    – Oxwivi
    Sep 15 '14 at 11:45














  • 1





    Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

    – user326219
    Sep 12 '14 at 15:23






  • 1





    @TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

    – Oxwivi
    Sep 15 '14 at 11:45








1




1





Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

– user326219
Sep 12 '14 at 15:23





Thanks very much for the syntax files in the git repo, I use this on all my servers now... keep up the good work matey !!!

– user326219
Sep 12 '14 at 15:23




1




1





@TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

– Oxwivi
Sep 15 '14 at 11:45





@TheGene Comment and thank on the answer. The repo is credited to him, not me, the one asking the question.

– Oxwivi
Sep 15 '14 at 11:45










12 Answers
12






active

oldest

votes


















165














The nano editor provides syntax highlighting for a few languages and scripts by itself. Check out /usr/share/nano/



nits@nits-excalibur:~$ ls /usr/share/nano/
asm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorc
awk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorc
c.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorc
cmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorc
css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
debian.nanorc makefile.nanorc objc.nanorc python.nanorc


Link them to your user's nano configuration file present at ~/.nanorc with something similiar to this line:



nits@nits-excalibur:~$ cat ~/.nanorc
include /usr/share/nano/sh.nanorc


Now, syntax highlighting is enabled in nano for whatever file you linked (You could also link multiple files)



screenshot of syntax highlighting



Note: Sometimes you might get a segmentation fault after you have edited your ~/.nanorc file. If such an error occurs, unsetting the LANG environment variable helps. You can unset it with unset LANG in the terminal. (Solution obtained from here)



There are also other solutions if you are not satisfied with your bash highlighting. One example of such can be found here



You can also write include /usr/share/nano/* to the ~/.nanorc file to enable all languages to be highlighted if your nano version supports it.






share|improve this answer





















  • 1





    Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

    – Oxwivi
    Dec 23 '11 at 16:31






  • 12





    Oh wait, I don't even have a ~/.nanorc file.

    – Oxwivi
    Dec 23 '11 at 16:33






  • 1





    Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

    – Oxwivi
    Dec 23 '11 at 16:53






  • 8





    ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

    – Thom Porter
    Feb 8 '16 at 0:10






  • 9





    include /usr/share/nano/* is not working

    – Jarek Jakubowski
    May 16 '16 at 8:23



















72














Yes you can, however the default syntax definitions are quite poor and incomplete. I'm maintaining a more accurate set of definitions here, for anyone who finds them useful.



To install, run:



git clone https://github.com/nanorc/nanorc.git
cd nanorc
make install


Add these lines to the ~/.nanorc



include ~/.nano/syntax/html.nanorc
include ~/.nano/syntax/css.nanorc
include ~/.nano/syntax/php.nanorc
include ~/.nano/syntax/ALL.nanorc


Specify the ones you want to have colorizing for, and you will have to tune these colors to your preferences. The ALL.nanorc describes features for all yet unclassified files. These are the tools you need to get started, not the end polished product.






share|improve this answer





















  • 6





    Thanks for keeping those nice syntax definitions in GitHub.

    – Rubens Mariuzzo
    Nov 13 '12 at 2:43






  • 3





    My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

    – Carlton
    Aug 6 '14 at 12:27








  • 5





    I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

    – Tom Busby
    Aug 27 '14 at 14:25






  • 5





    Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

    – dukevin
    Dec 8 '14 at 3:20






  • 5





    You have a dead link

    – not2qubit
    Oct 17 '18 at 7:45



















47














I used this command to quickly enable all available languages.



find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} ; >> ~/.nanorc


As mentioned in other answers, /usr/share/nano/ contains the definitions for different languages.



$ ls /usr/share/nano
asm.nanorc fortran.nanorc man-html ocaml.nanorc ruby.nanorc
awk.nanorc gentoo.nanorc man.nanorc patch.nanorc sh.nanorc
cmake.nanorc groff.nanorc mgp.nanorc perl.nanorc tcl.nanorc
c.nanorc html.nanorc mutt.nanorc php.nanorc tex.nanorc
css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
debian.nanorc makefile.nanorc objc.nanorc python.nanorc


Also mentioned, to enable highlighting for a language, you add include and the path to the language definition you want to enable to your ~/.nanorc file. So, for example, to enable C/C++ you would add this line.



include /usr/share/nano/c.nanorc


The find command searches for files or directories within the specified directory.




  • The -iname flag tells it to only look for files with a name that ends with .nanorc.

  • The -exec flags defines a command to execute on each file found.

  • The {} gets replaced with the file name.


  • ; is used to signify the end of the command to execute to the find command.

  • Lastly, >> ~/.nanorc causes the output to be appended to your ~/.nanorc file.






share|improve this answer


























  • great tip and explanation, thanks a lot man! ;)

    – daveoncode
    May 14 '16 at 17:02











  • Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

    – Milind
    Feb 17 at 0:06



















6














This should include all the syntax highlighting plugins included by default, and any you add to /usr/share/nano:



find /usr/share/nano -name '*.nanorc' -printf "include %pn" > ~/.nanorc


Or, edit /etc/nanorc and see if you can uncomment the includes.



This works if you have a version of nano that refuses to accept wildcards in the .nanorc file.



Just run this line every time you add an additional .nanorc colour config.






share|improve this answer

































    2














    I have some nano syntax highlighting at my github.



    There are live example screenshots for html and php:



    enter image description here



    and



    enter image description here






    share|improve this answer

































      2














      You can use this to include all: (add this to ~/nanorc file)



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


      Happy coding !






      share|improve this answer































        1














        wget -r -nH --cut-dirs=3 --no-parent --reject="index.html*" https://nanosyntax.googlecode.com/svn/trunk/syntax-nanorc/ -P ~/.nano-syntax
        for i in `ls --color=never -1 ~/.nano-syntax/*.nanorc` ; do echo "include $i" >> ~/.nanorc ; done





        share|improve this answer



















        • 22





          It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

          – Kevin Bowen
          Jun 28 '13 at 3:10



















        1














        The most complete and up to date syntax hilighters for nano are maintained here.



        To install all highlighters for your user just run:



        cd /tmp
        git clone https://github.com/tech4david/nano-highlight.git
        cd nano-highlight/
        make install
        echo "include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc





        share|improve this answer


























        • The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

          – A.B.
          Jul 30 '15 at 8:00











        • Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

          – A.B.
          Jul 30 '15 at 8:19






        • 1





          @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

          – Pablo Bianchi
          Oct 14 '17 at 21:06



















        1














        For those who are having trouble after following the instructions above, also check if you have duplicate definitions. These will disable all syntax highlighting for all files. I ran into this after adding a nanorc.nanorc file, and not realising that my ~/.nanorc already had an identical section, i.e.:



        ## Here is an example for nanorc files.
        ##
        syntax "nanorc" ".?nanorc$"
        ## Possible errors and parameters
        icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
        ## Keywords
        icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|$
        icolor green "^[[:space:]]*(set|unset|include|syntax)>"
        (...)





        share|improve this answer































          0














          I found syntax highlighting for js here.



          I appended it into my user file at ~/.nanorc



          However to get a file into which I could append, I had to first copy from /usr/share/nano/nanorc.nanorc to my local folder first as ~/.nanorc.






          share|improve this answer

































            0














            I accidentally disabled highlighting using the keyboard shortcut Alt+Y. It can be turned on again with the same keyboard shortcut.






            share|improve this answer































              -1














              I just made this script to add the colours to nano:
              But of course you got to have the color codes in /usr/share/nano for this to work.
              If there are errors: just manually edit the ~/.nanorc file and remove the lines that give the errors.



              #!/bin/bash

              for i in `ls /usr/share/nano`
              do
              echo "include /usr/share/nano/$i" >> ~/.nanorc
              done





              share|improve this answer


























              • Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                – muru
                Apr 11 '18 at 0:58












              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f90013%2fhow-do-i-enable-syntax-highlighting-in-nano%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              12 Answers
              12






              active

              oldest

              votes








              12 Answers
              12






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              165














              The nano editor provides syntax highlighting for a few languages and scripts by itself. Check out /usr/share/nano/



              nits@nits-excalibur:~$ ls /usr/share/nano/
              asm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorc
              c.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorc
              cmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Link them to your user's nano configuration file present at ~/.nanorc with something similiar to this line:



              nits@nits-excalibur:~$ cat ~/.nanorc
              include /usr/share/nano/sh.nanorc


              Now, syntax highlighting is enabled in nano for whatever file you linked (You could also link multiple files)



              screenshot of syntax highlighting



              Note: Sometimes you might get a segmentation fault after you have edited your ~/.nanorc file. If such an error occurs, unsetting the LANG environment variable helps. You can unset it with unset LANG in the terminal. (Solution obtained from here)



              There are also other solutions if you are not satisfied with your bash highlighting. One example of such can be found here



              You can also write include /usr/share/nano/* to the ~/.nanorc file to enable all languages to be highlighted if your nano version supports it.






              share|improve this answer





















              • 1





                Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:31






              • 12





                Oh wait, I don't even have a ~/.nanorc file.

                – Oxwivi
                Dec 23 '11 at 16:33






              • 1





                Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:53






              • 8





                ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

                – Thom Porter
                Feb 8 '16 at 0:10






              • 9





                include /usr/share/nano/* is not working

                – Jarek Jakubowski
                May 16 '16 at 8:23
















              165














              The nano editor provides syntax highlighting for a few languages and scripts by itself. Check out /usr/share/nano/



              nits@nits-excalibur:~$ ls /usr/share/nano/
              asm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorc
              c.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorc
              cmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Link them to your user's nano configuration file present at ~/.nanorc with something similiar to this line:



              nits@nits-excalibur:~$ cat ~/.nanorc
              include /usr/share/nano/sh.nanorc


              Now, syntax highlighting is enabled in nano for whatever file you linked (You could also link multiple files)



              screenshot of syntax highlighting



              Note: Sometimes you might get a segmentation fault after you have edited your ~/.nanorc file. If such an error occurs, unsetting the LANG environment variable helps. You can unset it with unset LANG in the terminal. (Solution obtained from here)



              There are also other solutions if you are not satisfied with your bash highlighting. One example of such can be found here



              You can also write include /usr/share/nano/* to the ~/.nanorc file to enable all languages to be highlighted if your nano version supports it.






              share|improve this answer





















              • 1





                Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:31






              • 12





                Oh wait, I don't even have a ~/.nanorc file.

                – Oxwivi
                Dec 23 '11 at 16:33






              • 1





                Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:53






              • 8





                ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

                – Thom Porter
                Feb 8 '16 at 0:10






              • 9





                include /usr/share/nano/* is not working

                – Jarek Jakubowski
                May 16 '16 at 8:23














              165












              165








              165







              The nano editor provides syntax highlighting for a few languages and scripts by itself. Check out /usr/share/nano/



              nits@nits-excalibur:~$ ls /usr/share/nano/
              asm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorc
              c.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorc
              cmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Link them to your user's nano configuration file present at ~/.nanorc with something similiar to this line:



              nits@nits-excalibur:~$ cat ~/.nanorc
              include /usr/share/nano/sh.nanorc


              Now, syntax highlighting is enabled in nano for whatever file you linked (You could also link multiple files)



              screenshot of syntax highlighting



              Note: Sometimes you might get a segmentation fault after you have edited your ~/.nanorc file. If such an error occurs, unsetting the LANG environment variable helps. You can unset it with unset LANG in the terminal. (Solution obtained from here)



              There are also other solutions if you are not satisfied with your bash highlighting. One example of such can be found here



              You can also write include /usr/share/nano/* to the ~/.nanorc file to enable all languages to be highlighted if your nano version supports it.






              share|improve this answer















              The nano editor provides syntax highlighting for a few languages and scripts by itself. Check out /usr/share/nano/



              nits@nits-excalibur:~$ ls /usr/share/nano/
              asm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorc
              c.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorc
              cmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Link them to your user's nano configuration file present at ~/.nanorc with something similiar to this line:



              nits@nits-excalibur:~$ cat ~/.nanorc
              include /usr/share/nano/sh.nanorc


              Now, syntax highlighting is enabled in nano for whatever file you linked (You could also link multiple files)



              screenshot of syntax highlighting



              Note: Sometimes you might get a segmentation fault after you have edited your ~/.nanorc file. If such an error occurs, unsetting the LANG environment variable helps. You can unset it with unset LANG in the terminal. (Solution obtained from here)



              There are also other solutions if you are not satisfied with your bash highlighting. One example of such can be found here



              You can also write include /usr/share/nano/* to the ~/.nanorc file to enable all languages to be highlighted if your nano version supports it.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Oct 29 '16 at 13:20









              Alexander Craggs

              1034




              1034










              answered Dec 23 '11 at 16:07









              Nitin VenkateshNitin Venkatesh

              16.4k116087




              16.4k116087








              • 1





                Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:31






              • 12





                Oh wait, I don't even have a ~/.nanorc file.

                – Oxwivi
                Dec 23 '11 at 16:33






              • 1





                Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:53






              • 8





                ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

                – Thom Porter
                Feb 8 '16 at 0:10






              • 9





                include /usr/share/nano/* is not working

                – Jarek Jakubowski
                May 16 '16 at 8:23














              • 1





                Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:31






              • 12





                Oh wait, I don't even have a ~/.nanorc file.

                – Oxwivi
                Dec 23 '11 at 16:33






              • 1





                Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

                – Oxwivi
                Dec 23 '11 at 16:53






              • 8





                ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

                – Thom Porter
                Feb 8 '16 at 0:10






              • 9





                include /usr/share/nano/* is not working

                – Jarek Jakubowski
                May 16 '16 at 8:23








              1




              1





              Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

              – Oxwivi
              Dec 23 '11 at 16:31





              Those lines are uncommented in /etc/nanorc - are the global settings being overwritten by ~/.nanorc? How do I disable .nanorc?

              – Oxwivi
              Dec 23 '11 at 16:31




              12




              12





              Oh wait, I don't even have a ~/.nanorc file.

              – Oxwivi
              Dec 23 '11 at 16:33





              Oh wait, I don't even have a ~/.nanorc file.

              – Oxwivi
              Dec 23 '11 at 16:33




              1




              1





              Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

              – Oxwivi
              Dec 23 '11 at 16:53





              Wait, wait, how come the global setting with all the include lines not enabling syntax highlights even though I have not .nanorc?

              – Oxwivi
              Dec 23 '11 at 16:53




              8




              8





              ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

              – Thom Porter
              Feb 8 '16 at 0:10





              ls -1 /usr/share/nano/*.nanorc | sed 's/^//include //' >> ~/.nanorc append them all to your .nanorc file, or create it if it does not exist.

              – Thom Porter
              Feb 8 '16 at 0:10




              9




              9





              include /usr/share/nano/* is not working

              – Jarek Jakubowski
              May 16 '16 at 8:23





              include /usr/share/nano/* is not working

              – Jarek Jakubowski
              May 16 '16 at 8:23













              72














              Yes you can, however the default syntax definitions are quite poor and incomplete. I'm maintaining a more accurate set of definitions here, for anyone who finds them useful.



              To install, run:



              git clone https://github.com/nanorc/nanorc.git
              cd nanorc
              make install


              Add these lines to the ~/.nanorc



              include ~/.nano/syntax/html.nanorc
              include ~/.nano/syntax/css.nanorc
              include ~/.nano/syntax/php.nanorc
              include ~/.nano/syntax/ALL.nanorc


              Specify the ones you want to have colorizing for, and you will have to tune these colors to your preferences. The ALL.nanorc describes features for all yet unclassified files. These are the tools you need to get started, not the end polished product.






              share|improve this answer





















              • 6





                Thanks for keeping those nice syntax definitions in GitHub.

                – Rubens Mariuzzo
                Nov 13 '12 at 2:43






              • 3





                My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

                – Carlton
                Aug 6 '14 at 12:27








              • 5





                I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

                – Tom Busby
                Aug 27 '14 at 14:25






              • 5





                Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

                – dukevin
                Dec 8 '14 at 3:20






              • 5





                You have a dead link

                – not2qubit
                Oct 17 '18 at 7:45
















              72














              Yes you can, however the default syntax definitions are quite poor and incomplete. I'm maintaining a more accurate set of definitions here, for anyone who finds them useful.



              To install, run:



              git clone https://github.com/nanorc/nanorc.git
              cd nanorc
              make install


              Add these lines to the ~/.nanorc



              include ~/.nano/syntax/html.nanorc
              include ~/.nano/syntax/css.nanorc
              include ~/.nano/syntax/php.nanorc
              include ~/.nano/syntax/ALL.nanorc


              Specify the ones you want to have colorizing for, and you will have to tune these colors to your preferences. The ALL.nanorc describes features for all yet unclassified files. These are the tools you need to get started, not the end polished product.






              share|improve this answer





















              • 6





                Thanks for keeping those nice syntax definitions in GitHub.

                – Rubens Mariuzzo
                Nov 13 '12 at 2:43






              • 3





                My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

                – Carlton
                Aug 6 '14 at 12:27








              • 5





                I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

                – Tom Busby
                Aug 27 '14 at 14:25






              • 5





                Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

                – dukevin
                Dec 8 '14 at 3:20






              • 5





                You have a dead link

                – not2qubit
                Oct 17 '18 at 7:45














              72












              72








              72







              Yes you can, however the default syntax definitions are quite poor and incomplete. I'm maintaining a more accurate set of definitions here, for anyone who finds them useful.



              To install, run:



              git clone https://github.com/nanorc/nanorc.git
              cd nanorc
              make install


              Add these lines to the ~/.nanorc



              include ~/.nano/syntax/html.nanorc
              include ~/.nano/syntax/css.nanorc
              include ~/.nano/syntax/php.nanorc
              include ~/.nano/syntax/ALL.nanorc


              Specify the ones you want to have colorizing for, and you will have to tune these colors to your preferences. The ALL.nanorc describes features for all yet unclassified files. These are the tools you need to get started, not the end polished product.






              share|improve this answer















              Yes you can, however the default syntax definitions are quite poor and incomplete. I'm maintaining a more accurate set of definitions here, for anyone who finds them useful.



              To install, run:



              git clone https://github.com/nanorc/nanorc.git
              cd nanorc
              make install


              Add these lines to the ~/.nanorc



              include ~/.nano/syntax/html.nanorc
              include ~/.nano/syntax/css.nanorc
              include ~/.nano/syntax/php.nanorc
              include ~/.nano/syntax/ALL.nanorc


              Specify the ones you want to have colorizing for, and you will have to tune these colors to your preferences. The ALL.nanorc describes features for all yet unclassified files. These are the tools you need to get started, not the end polished product.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 3 '15 at 7:14









              Eric Leschinski

              1,50211319




              1,50211319










              answered Aug 27 '12 at 16:17









              Craig BarnesCraig Barnes

              73752




              73752








              • 6





                Thanks for keeping those nice syntax definitions in GitHub.

                – Rubens Mariuzzo
                Nov 13 '12 at 2:43






              • 3





                My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

                – Carlton
                Aug 6 '14 at 12:27








              • 5





                I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

                – Tom Busby
                Aug 27 '14 at 14:25






              • 5





                Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

                – dukevin
                Dec 8 '14 at 3:20






              • 5





                You have a dead link

                – not2qubit
                Oct 17 '18 at 7:45














              • 6





                Thanks for keeping those nice syntax definitions in GitHub.

                – Rubens Mariuzzo
                Nov 13 '12 at 2:43






              • 3





                My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

                – Carlton
                Aug 6 '14 at 12:27








              • 5





                I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

                – Tom Busby
                Aug 27 '14 at 14:25






              • 5





                Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

                – dukevin
                Dec 8 '14 at 3:20






              • 5





                You have a dead link

                – not2qubit
                Oct 17 '18 at 7:45








              6




              6





              Thanks for keeping those nice syntax definitions in GitHub.

              – Rubens Mariuzzo
              Nov 13 '12 at 2:43





              Thanks for keeping those nice syntax definitions in GitHub.

              – Rubens Mariuzzo
              Nov 13 '12 at 2:43




              3




              3





              My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

              – Carlton
              Aug 6 '14 at 12:27







              My *.js files weren't working...edited /etc/nanorc to remove any other syntax includes as per the FAQ github.com/nanorc/…. ♥ Nano ♥ nanorc

              – Carlton
              Aug 6 '14 at 12:27






              5




              5





              I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

              – Tom Busby
              Aug 27 '14 at 14:25





              I just installed your syntax defs on Mac OSX. There's only one thing I'd note, which is the black colour of the open-bracket in python gets lost against the black background of my terminal

              – Tom Busby
              Aug 27 '14 at 14:25




              5




              5





              Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

              – dukevin
              Dec 8 '14 at 3:20





              Actually there is a problem, some of the colored text is black! If our terminal background is black, these words are invisible!

              – dukevin
              Dec 8 '14 at 3:20




              5




              5





              You have a dead link

              – not2qubit
              Oct 17 '18 at 7:45





              You have a dead link

              – not2qubit
              Oct 17 '18 at 7:45











              47














              I used this command to quickly enable all available languages.



              find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} ; >> ~/.nanorc


              As mentioned in other answers, /usr/share/nano/ contains the definitions for different languages.



              $ ls /usr/share/nano
              asm.nanorc fortran.nanorc man-html ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc man.nanorc patch.nanorc sh.nanorc
              cmake.nanorc groff.nanorc mgp.nanorc perl.nanorc tcl.nanorc
              c.nanorc html.nanorc mutt.nanorc php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Also mentioned, to enable highlighting for a language, you add include and the path to the language definition you want to enable to your ~/.nanorc file. So, for example, to enable C/C++ you would add this line.



              include /usr/share/nano/c.nanorc


              The find command searches for files or directories within the specified directory.




              • The -iname flag tells it to only look for files with a name that ends with .nanorc.

              • The -exec flags defines a command to execute on each file found.

              • The {} gets replaced with the file name.


              • ; is used to signify the end of the command to execute to the find command.

              • Lastly, >> ~/.nanorc causes the output to be appended to your ~/.nanorc file.






              share|improve this answer


























              • great tip and explanation, thanks a lot man! ;)

                – daveoncode
                May 14 '16 at 17:02











              • Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

                – Milind
                Feb 17 at 0:06
















              47














              I used this command to quickly enable all available languages.



              find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} ; >> ~/.nanorc


              As mentioned in other answers, /usr/share/nano/ contains the definitions for different languages.



              $ ls /usr/share/nano
              asm.nanorc fortran.nanorc man-html ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc man.nanorc patch.nanorc sh.nanorc
              cmake.nanorc groff.nanorc mgp.nanorc perl.nanorc tcl.nanorc
              c.nanorc html.nanorc mutt.nanorc php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Also mentioned, to enable highlighting for a language, you add include and the path to the language definition you want to enable to your ~/.nanorc file. So, for example, to enable C/C++ you would add this line.



              include /usr/share/nano/c.nanorc


              The find command searches for files or directories within the specified directory.




              • The -iname flag tells it to only look for files with a name that ends with .nanorc.

              • The -exec flags defines a command to execute on each file found.

              • The {} gets replaced with the file name.


              • ; is used to signify the end of the command to execute to the find command.

              • Lastly, >> ~/.nanorc causes the output to be appended to your ~/.nanorc file.






              share|improve this answer


























              • great tip and explanation, thanks a lot man! ;)

                – daveoncode
                May 14 '16 at 17:02











              • Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

                – Milind
                Feb 17 at 0:06














              47












              47








              47







              I used this command to quickly enable all available languages.



              find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} ; >> ~/.nanorc


              As mentioned in other answers, /usr/share/nano/ contains the definitions for different languages.



              $ ls /usr/share/nano
              asm.nanorc fortran.nanorc man-html ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc man.nanorc patch.nanorc sh.nanorc
              cmake.nanorc groff.nanorc mgp.nanorc perl.nanorc tcl.nanorc
              c.nanorc html.nanorc mutt.nanorc php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Also mentioned, to enable highlighting for a language, you add include and the path to the language definition you want to enable to your ~/.nanorc file. So, for example, to enable C/C++ you would add this line.



              include /usr/share/nano/c.nanorc


              The find command searches for files or directories within the specified directory.




              • The -iname flag tells it to only look for files with a name that ends with .nanorc.

              • The -exec flags defines a command to execute on each file found.

              • The {} gets replaced with the file name.


              • ; is used to signify the end of the command to execute to the find command.

              • Lastly, >> ~/.nanorc causes the output to be appended to your ~/.nanorc file.






              share|improve this answer















              I used this command to quickly enable all available languages.



              find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} ; >> ~/.nanorc


              As mentioned in other answers, /usr/share/nano/ contains the definitions for different languages.



              $ ls /usr/share/nano
              asm.nanorc fortran.nanorc man-html ocaml.nanorc ruby.nanorc
              awk.nanorc gentoo.nanorc man.nanorc patch.nanorc sh.nanorc
              cmake.nanorc groff.nanorc mgp.nanorc perl.nanorc tcl.nanorc
              c.nanorc html.nanorc mutt.nanorc php.nanorc tex.nanorc
              css.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorc
              debian.nanorc makefile.nanorc objc.nanorc python.nanorc


              Also mentioned, to enable highlighting for a language, you add include and the path to the language definition you want to enable to your ~/.nanorc file. So, for example, to enable C/C++ you would add this line.



              include /usr/share/nano/c.nanorc


              The find command searches for files or directories within the specified directory.




              • The -iname flag tells it to only look for files with a name that ends with .nanorc.

              • The -exec flags defines a command to execute on each file found.

              • The {} gets replaced with the file name.


              • ; is used to signify the end of the command to execute to the find command.

              • Lastly, >> ~/.nanorc causes the output to be appended to your ~/.nanorc file.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 8 '16 at 18:04

























              answered Oct 18 '14 at 18:22









              Drew ChapinDrew Chapin

              61955




              61955













              • great tip and explanation, thanks a lot man! ;)

                – daveoncode
                May 14 '16 at 17:02











              • Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

                – Milind
                Feb 17 at 0:06



















              • great tip and explanation, thanks a lot man! ;)

                – daveoncode
                May 14 '16 at 17:02











              • Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

                – Milind
                Feb 17 at 0:06

















              great tip and explanation, thanks a lot man! ;)

              – daveoncode
              May 14 '16 at 17:02





              great tip and explanation, thanks a lot man! ;)

              – daveoncode
              May 14 '16 at 17:02













              Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

              – Milind
              Feb 17 at 0:06





              Thanks and doesn't look like you need the iname flag. The following seems to work as well find /usr/share/nano/*.nanorc

              – Milind
              Feb 17 at 0:06











              6














              This should include all the syntax highlighting plugins included by default, and any you add to /usr/share/nano:



              find /usr/share/nano -name '*.nanorc' -printf "include %pn" > ~/.nanorc


              Or, edit /etc/nanorc and see if you can uncomment the includes.



              This works if you have a version of nano that refuses to accept wildcards in the .nanorc file.



              Just run this line every time you add an additional .nanorc colour config.






              share|improve this answer






























                6














                This should include all the syntax highlighting plugins included by default, and any you add to /usr/share/nano:



                find /usr/share/nano -name '*.nanorc' -printf "include %pn" > ~/.nanorc


                Or, edit /etc/nanorc and see if you can uncomment the includes.



                This works if you have a version of nano that refuses to accept wildcards in the .nanorc file.



                Just run this line every time you add an additional .nanorc colour config.






                share|improve this answer




























                  6












                  6








                  6







                  This should include all the syntax highlighting plugins included by default, and any you add to /usr/share/nano:



                  find /usr/share/nano -name '*.nanorc' -printf "include %pn" > ~/.nanorc


                  Or, edit /etc/nanorc and see if you can uncomment the includes.



                  This works if you have a version of nano that refuses to accept wildcards in the .nanorc file.



                  Just run this line every time you add an additional .nanorc colour config.






                  share|improve this answer















                  This should include all the syntax highlighting plugins included by default, and any you add to /usr/share/nano:



                  find /usr/share/nano -name '*.nanorc' -printf "include %pn" > ~/.nanorc


                  Or, edit /etc/nanorc and see if you can uncomment the includes.



                  This works if you have a version of nano that refuses to accept wildcards in the .nanorc file.



                  Just run this line every time you add an additional .nanorc colour config.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 16 '17 at 19:42

























                  answered Dec 28 '16 at 14:23









                  NotoriousPyroNotoriousPyro

                  18613




                  18613























                      2














                      I have some nano syntax highlighting at my github.



                      There are live example screenshots for html and php:



                      enter image description here



                      and



                      enter image description here






                      share|improve this answer






























                        2














                        I have some nano syntax highlighting at my github.



                        There are live example screenshots for html and php:



                        enter image description here



                        and



                        enter image description here






                        share|improve this answer




























                          2












                          2








                          2







                          I have some nano syntax highlighting at my github.



                          There are live example screenshots for html and php:



                          enter image description here



                          and



                          enter image description here






                          share|improve this answer















                          I have some nano syntax highlighting at my github.



                          There are live example screenshots for html and php:



                          enter image description here



                          and



                          enter image description here







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jul 30 '15 at 8:25









                          A.B.

                          70.1k12173269




                          70.1k12173269










                          answered May 3 '15 at 6:57









                          Eric LeschinskiEric Leschinski

                          1,50211319




                          1,50211319























                              2














                              You can use this to include all: (add this to ~/nanorc file)



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


                              Happy coding !






                              share|improve this answer




























                                2














                                You can use this to include all: (add this to ~/nanorc file)



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


                                Happy coding !






                                share|improve this answer


























                                  2












                                  2








                                  2







                                  You can use this to include all: (add this to ~/nanorc file)



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


                                  Happy coding !






                                  share|improve this answer













                                  You can use this to include all: (add this to ~/nanorc file)



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


                                  Happy coding !







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Feb 12 '16 at 4:00









                                  Norbert MezeiNorbert Mezei

                                  212




                                  212























                                      1














                                      wget -r -nH --cut-dirs=3 --no-parent --reject="index.html*" https://nanosyntax.googlecode.com/svn/trunk/syntax-nanorc/ -P ~/.nano-syntax
                                      for i in `ls --color=never -1 ~/.nano-syntax/*.nanorc` ; do echo "include $i" >> ~/.nanorc ; done





                                      share|improve this answer



















                                      • 22





                                        It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                        – Kevin Bowen
                                        Jun 28 '13 at 3:10
















                                      1














                                      wget -r -nH --cut-dirs=3 --no-parent --reject="index.html*" https://nanosyntax.googlecode.com/svn/trunk/syntax-nanorc/ -P ~/.nano-syntax
                                      for i in `ls --color=never -1 ~/.nano-syntax/*.nanorc` ; do echo "include $i" >> ~/.nanorc ; done





                                      share|improve this answer



















                                      • 22





                                        It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                        – Kevin Bowen
                                        Jun 28 '13 at 3:10














                                      1












                                      1








                                      1







                                      wget -r -nH --cut-dirs=3 --no-parent --reject="index.html*" https://nanosyntax.googlecode.com/svn/trunk/syntax-nanorc/ -P ~/.nano-syntax
                                      for i in `ls --color=never -1 ~/.nano-syntax/*.nanorc` ; do echo "include $i" >> ~/.nanorc ; done





                                      share|improve this answer













                                      wget -r -nH --cut-dirs=3 --no-parent --reject="index.html*" https://nanosyntax.googlecode.com/svn/trunk/syntax-nanorc/ -P ~/.nano-syntax
                                      for i in `ls --color=never -1 ~/.nano-syntax/*.nanorc` ; do echo "include $i" >> ~/.nanorc ; done






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jun 28 '13 at 3:08









                                      user170859user170859

                                      271




                                      271








                                      • 22





                                        It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                        – Kevin Bowen
                                        Jun 28 '13 at 3:10














                                      • 22





                                        It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                        – Kevin Bowen
                                        Jun 28 '13 at 3:10








                                      22




                                      22





                                      It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                      – Kevin Bowen
                                      Jun 28 '13 at 3:10





                                      It would be helpful if you could explain why this is a useful answer for newer users. What is the command doing? What does it change? Randomly suggesting to run a command line is not helpful.

                                      – Kevin Bowen
                                      Jun 28 '13 at 3:10











                                      1














                                      The most complete and up to date syntax hilighters for nano are maintained here.



                                      To install all highlighters for your user just run:



                                      cd /tmp
                                      git clone https://github.com/tech4david/nano-highlight.git
                                      cd nano-highlight/
                                      make install
                                      echo "include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc





                                      share|improve this answer


























                                      • The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                        – A.B.
                                        Jul 30 '15 at 8:00











                                      • Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                        – A.B.
                                        Jul 30 '15 at 8:19






                                      • 1





                                        @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                        – Pablo Bianchi
                                        Oct 14 '17 at 21:06
















                                      1














                                      The most complete and up to date syntax hilighters for nano are maintained here.



                                      To install all highlighters for your user just run:



                                      cd /tmp
                                      git clone https://github.com/tech4david/nano-highlight.git
                                      cd nano-highlight/
                                      make install
                                      echo "include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc





                                      share|improve this answer


























                                      • The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                        – A.B.
                                        Jul 30 '15 at 8:00











                                      • Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                        – A.B.
                                        Jul 30 '15 at 8:19






                                      • 1





                                        @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                        – Pablo Bianchi
                                        Oct 14 '17 at 21:06














                                      1












                                      1








                                      1







                                      The most complete and up to date syntax hilighters for nano are maintained here.



                                      To install all highlighters for your user just run:



                                      cd /tmp
                                      git clone https://github.com/tech4david/nano-highlight.git
                                      cd nano-highlight/
                                      make install
                                      echo "include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc





                                      share|improve this answer















                                      The most complete and up to date syntax hilighters for nano are maintained here.



                                      To install all highlighters for your user just run:



                                      cd /tmp
                                      git clone https://github.com/tech4david/nano-highlight.git
                                      cd nano-highlight/
                                      make install
                                      echo "include ~/.nano/syntax/ALL.nanorc" >> ~/.nanorc






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Aug 2 '15 at 12:40

























                                      answered Jul 29 '15 at 10:21









                                      RaverenRaveren

                                      1137




                                      1137













                                      • The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                        – A.B.
                                        Jul 30 '15 at 8:00











                                      • Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                        – A.B.
                                        Jul 30 '15 at 8:19






                                      • 1





                                        @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                        – Pablo Bianchi
                                        Oct 14 '17 at 21:06



















                                      • The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                        – A.B.
                                        Jul 30 '15 at 8:00











                                      • Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                        – A.B.
                                        Jul 30 '15 at 8:19






                                      • 1





                                        @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                        – Pablo Bianchi
                                        Oct 14 '17 at 21:06

















                                      The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                      – A.B.
                                      Jul 30 '15 at 8:00





                                      The solution is good, but I would use an other folder for git clone. The content otf the /tmp folder will be deleted on every system start and therefore you could never run a git pull.

                                      – A.B.
                                      Jul 30 '15 at 8:00













                                      Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                      – A.B.
                                      Jul 30 '15 at 8:19





                                      Your language tag is wrong. js isn't bash or shell-script and I have placed the link behind the word here. Where is the problem?

                                      – A.B.
                                      Jul 30 '15 at 8:19




                                      1




                                      1





                                      @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                      – Pablo Bianchi
                                      Oct 14 '17 at 21:06





                                      @A.B. it doesn't matter if that folder is gone since when you make install all the syntax files are copied to the safe place where they belong: ~/.nano/syntax.

                                      – Pablo Bianchi
                                      Oct 14 '17 at 21:06











                                      1














                                      For those who are having trouble after following the instructions above, also check if you have duplicate definitions. These will disable all syntax highlighting for all files. I ran into this after adding a nanorc.nanorc file, and not realising that my ~/.nanorc already had an identical section, i.e.:



                                      ## Here is an example for nanorc files.
                                      ##
                                      syntax "nanorc" ".?nanorc$"
                                      ## Possible errors and parameters
                                      icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
                                      ## Keywords
                                      icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|$
                                      icolor green "^[[:space:]]*(set|unset|include|syntax)>"
                                      (...)





                                      share|improve this answer




























                                        1














                                        For those who are having trouble after following the instructions above, also check if you have duplicate definitions. These will disable all syntax highlighting for all files. I ran into this after adding a nanorc.nanorc file, and not realising that my ~/.nanorc already had an identical section, i.e.:



                                        ## Here is an example for nanorc files.
                                        ##
                                        syntax "nanorc" ".?nanorc$"
                                        ## Possible errors and parameters
                                        icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
                                        ## Keywords
                                        icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|$
                                        icolor green "^[[:space:]]*(set|unset|include|syntax)>"
                                        (...)





                                        share|improve this answer


























                                          1












                                          1








                                          1







                                          For those who are having trouble after following the instructions above, also check if you have duplicate definitions. These will disable all syntax highlighting for all files. I ran into this after adding a nanorc.nanorc file, and not realising that my ~/.nanorc already had an identical section, i.e.:



                                          ## Here is an example for nanorc files.
                                          ##
                                          syntax "nanorc" ".?nanorc$"
                                          ## Possible errors and parameters
                                          icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
                                          ## Keywords
                                          icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|$
                                          icolor green "^[[:space:]]*(set|unset|include|syntax)>"
                                          (...)





                                          share|improve this answer













                                          For those who are having trouble after following the instructions above, also check if you have duplicate definitions. These will disable all syntax highlighting for all files. I ran into this after adding a nanorc.nanorc file, and not realising that my ~/.nanorc already had an identical section, i.e.:



                                          ## Here is an example for nanorc files.
                                          ##
                                          syntax "nanorc" ".?nanorc$"
                                          ## Possible errors and parameters
                                          icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
                                          ## Keywords
                                          icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|$
                                          icolor green "^[[:space:]]*(set|unset|include|syntax)>"
                                          (...)






                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Feb 19 '16 at 4:50









                                          dmviannadmvianna

                                          838




                                          838























                                              0














                                              I found syntax highlighting for js here.



                                              I appended it into my user file at ~/.nanorc



                                              However to get a file into which I could append, I had to first copy from /usr/share/nano/nanorc.nanorc to my local folder first as ~/.nanorc.






                                              share|improve this answer






























                                                0














                                                I found syntax highlighting for js here.



                                                I appended it into my user file at ~/.nanorc



                                                However to get a file into which I could append, I had to first copy from /usr/share/nano/nanorc.nanorc to my local folder first as ~/.nanorc.






                                                share|improve this answer




























                                                  0












                                                  0








                                                  0







                                                  I found syntax highlighting for js here.



                                                  I appended it into my user file at ~/.nanorc



                                                  However to get a file into which I could append, I had to first copy from /usr/share/nano/nanorc.nanorc to my local folder first as ~/.nanorc.






                                                  share|improve this answer















                                                  I found syntax highlighting for js here.



                                                  I appended it into my user file at ~/.nanorc



                                                  However to get a file into which I could append, I had to first copy from /usr/share/nano/nanorc.nanorc to my local folder first as ~/.nanorc.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Jul 30 '15 at 8:24









                                                  A.B.

                                                  70.1k12173269




                                                  70.1k12173269










                                                  answered Jul 5 '15 at 23:21









                                                  Forrest EricksonForrest Erickson

                                                  1




                                                  1























                                                      0














                                                      I accidentally disabled highlighting using the keyboard shortcut Alt+Y. It can be turned on again with the same keyboard shortcut.






                                                      share|improve this answer




























                                                        0














                                                        I accidentally disabled highlighting using the keyboard shortcut Alt+Y. It can be turned on again with the same keyboard shortcut.






                                                        share|improve this answer


























                                                          0












                                                          0








                                                          0







                                                          I accidentally disabled highlighting using the keyboard shortcut Alt+Y. It can be turned on again with the same keyboard shortcut.






                                                          share|improve this answer













                                                          I accidentally disabled highlighting using the keyboard shortcut Alt+Y. It can be turned on again with the same keyboard shortcut.







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered 17 hours ago









                                                          Thomas WellerThomas Weller

                                                          1,26911430




                                                          1,26911430























                                                              -1














                                                              I just made this script to add the colours to nano:
                                                              But of course you got to have the color codes in /usr/share/nano for this to work.
                                                              If there are errors: just manually edit the ~/.nanorc file and remove the lines that give the errors.



                                                              #!/bin/bash

                                                              for i in `ls /usr/share/nano`
                                                              do
                                                              echo "include /usr/share/nano/$i" >> ~/.nanorc
                                                              done





                                                              share|improve this answer


























                                                              • Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                                – muru
                                                                Apr 11 '18 at 0:58
















                                                              -1














                                                              I just made this script to add the colours to nano:
                                                              But of course you got to have the color codes in /usr/share/nano for this to work.
                                                              If there are errors: just manually edit the ~/.nanorc file and remove the lines that give the errors.



                                                              #!/bin/bash

                                                              for i in `ls /usr/share/nano`
                                                              do
                                                              echo "include /usr/share/nano/$i" >> ~/.nanorc
                                                              done





                                                              share|improve this answer


























                                                              • Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                                – muru
                                                                Apr 11 '18 at 0:58














                                                              -1












                                                              -1








                                                              -1







                                                              I just made this script to add the colours to nano:
                                                              But of course you got to have the color codes in /usr/share/nano for this to work.
                                                              If there are errors: just manually edit the ~/.nanorc file and remove the lines that give the errors.



                                                              #!/bin/bash

                                                              for i in `ls /usr/share/nano`
                                                              do
                                                              echo "include /usr/share/nano/$i" >> ~/.nanorc
                                                              done





                                                              share|improve this answer















                                                              I just made this script to add the colours to nano:
                                                              But of course you got to have the color codes in /usr/share/nano for this to work.
                                                              If there are errors: just manually edit the ~/.nanorc file and remove the lines that give the errors.



                                                              #!/bin/bash

                                                              for i in `ls /usr/share/nano`
                                                              do
                                                              echo "include /usr/share/nano/$i" >> ~/.nanorc
                                                              done






                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited Feb 4 '16 at 10:40

























                                                              answered Feb 4 '16 at 10:35









                                                              some_random_guysome_random_guy

                                                              12




                                                              12













                                                              • Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                                – muru
                                                                Apr 11 '18 at 0:58



















                                                              • Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                                – muru
                                                                Apr 11 '18 at 0:58

















                                                              Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                              – muru
                                                              Apr 11 '18 at 0:58





                                                              Pretty much the same as askubuntu.com/a/865425/158442 and askubuntu.com/a/538674/158442 do

                                                              – muru
                                                              Apr 11 '18 at 0:58


















                                                              draft saved

                                                              draft discarded




















































                                                              Thanks for contributing an answer to Ask Ubuntu!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f90013%2fhow-do-i-enable-syntax-highlighting-in-nano%23new-answer', 'question_page');
                                                              }
                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                                                              Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                                                              Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...