Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed the Macports version of the nano text editor

sudo port install nano +colors

and now i have all the syntax highlighting nanorc files

ls /opt/local/share/nano



drwxr-xr-x  31 root  admin  1054 30 Set 19:51 ./
drwxr-xr-x  14 root  admin   476 30 Set 19:51 ../
-rw-r--r--   1 root  admin   783 20 Nov  2012 asm.nanorc
-rw-r--r--   1 root  admin  1504 20 Nov  2012 awk.nanorc
-rw-r--r--   1 root  admin  1514 20 Nov  2012 c.nanorc
-rw-r--r--   1 root  admin   828 20 Nov  2012 cmake.nanorc
-rw-r--r--   1 root  admin   331 20 Nov  2012 css.nanorc
-rw-r--r--   1 root  admin   680 20 Nov  2012 debian.nanorc
-rw-r--r--   1 root  admin  2032 20 Nov  2012 fortran.nanorc
-rw-r--r--   1 root  admin  3139 20 Nov  2012 gentoo.nanorc
-rw-r--r--   1 root  admin   723 20 Nov  2012 groff.nanorc
-rw-r--r--   1 root  admin   124 20 Nov  2012 html.nanorc
-rw-r--r--   1 root  admin   610 20 Nov  2012 java.nanorc
-rw-r--r--   1 root  admin   248 20 Nov  2012 makefile.nanorc
drwxr-xr-x   6 root  admin   204 30 Set 19:51 man-html/
-rw-r--r--   1 root  admin   264 20 Nov  2012 man.nanorc
-rw-r--r--   1 root  admin   219 20 Nov  2012 mgp.nanorc
-rw-r--r--   1 root  admin    95 20 Nov  2012 mutt.nanorc
-rw-r--r--   1 root  admin  1110 20 Nov  2012 nanorc.nanorc
-rw-r--r--   1 root  admin  1696 20 Nov  2012 objc.nanorc
-rw-r--r--   1 root  admin   791 20 Nov  2012 ocaml.nanorc
-rw-r--r--   1 root  admin   242 20 Nov  2012 patch.nanorc
-rw-r--r--   1 root  admin  1438 20 Nov  2012 perl.nanorc
-rw-r--r--   1 root  admin   687 20 Nov  2012 php.nanorc
-rw-r--r--   1 root  admin   682 20 Nov  2012 pov.nanorc
-rw-r--r--   1 root  admin   527 20 Nov  2012 python.nanorc
-rw-r--r--   1 root  admin  1475 20 Nov  2012 ruby.nanorc
-rw-r--r--   1 root  admin   691 20 Nov  2012 sh.nanorc
-rw-r--r--   1 root  admin  2110 20 Nov  2012 tcl.nanorc
-rw-r--r--   1 root  admin   141 20 Nov  2012 tex.nanorc
-rw-r--r--   1 root  admin   260 20 Nov  2012 xml.nanorc

so I created a ~/.nanorc config file

## Nanorc files
include "/opt/local/share/nano/nanorc.nanorc"
## C/C++
include "/opt/local/share/nano/c.nanorc"
## Cascading Style Sheets
include "/opt/local/share/nano/css.nanorc"
...

This is working just for .nanorc files... What am I doing wrong?

share|improve this question
    
If you type nano -V does it show --enable-color among the options? How are you testing? Did you open a .c file? If I create a new file and put python code in it, it won't show up with highlighting until I save it with the appropriate extension. –  beroe Sep 30 '13 at 21:42
    
@beroe Yes i'm opening a .c file or a .py file. --enable-color shown. –  SolidSnake Oct 1 '13 at 17:19
    
Do you have a sense whether your .nanorc is getting sourced? Does ` --enable-nanorc` also show up in the options? You could try introducing an error (echo HELLO) into your .nanorc file and see if you get an error message when launching it. –  beroe Oct 1 '13 at 18:57
    
Yup! .nanorc is sourcing... It shows in options --enable-nanorc and it gives me errors when launching it... o.O' –  SolidSnake Oct 2 '13 at 8:56
1  
Bummer! Any reason you used the macports version? It worked for me with the pre-installed nano and just grabbing the nanorc files from an archive. –  beroe Oct 2 '13 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.