Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Has anyone got (or can point in the direction of) a nanorc file that contains syntax highlighting for C# and/or ASP.Net?

share|improve this question
There is an emacs one, but that wasn't your question ;-) – Chris Huang-Leaver Aug 15 '10 at 7:24
Are you kidding right? Why would you use that editor for C# programming. Try [MonoDevelop][1], if you're serious about learning C# in Linux, it's WAY BETTER, in my humble opinion. [1]: – Mnemonic Flow Aug 18 '10 at 21:45
Oh I have MonoDevelop set up too, but sometimes I need to work over a console-only SSH session – Rob Cowell Aug 19 '10 at 14:17
Ugh... this really makes me hope my proposal gets some traction because I kinda feel that this has no business here.... this is a site about unix not development environments. – xenoterracide Aug 25 '10 at 14:43

2 Answers 2

up vote 3 down vote accepted

Using the Java example from, you can try to add something like the following into your ~/.nanorc:

syntax "C# source" "\.cs$"
color green "\<(bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|new|object|short|ushort|string|base|this|void)\>"
color red "\<(as|break|case|catch|checked|continue|default|do|else|finally|fixed|for|foreach|goto|if|is|lock|return|switch|throw|try|unchecked|while)\>"
color cyan "\<(abstract|class|const|delegate|enum|event|explicit|extern|implicit|in|internal|interface|namespace|operator|out|override|params|private|protected|public|readonly|ref|sealed|sizeof|static|struct|typeof|using|virtual|volatile)\>"
color red ""[^\"]*""
color yellow "\<(true|false|null)\>"
color blue "//.*"
color blue start="/\*" end="\*/"
color brightblue start="/\*\*" end="\*/"
color brightgreen,green " +$"
share|improve this answer

Duplicated here:

share|improve this answer
True, but not all Unix/Linux users are Ubuntu users. The Ubuntu SE site was in public beta first too... – Rob Cowell Aug 19 '10 at 14:16

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.