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

  • There is an emacs one, but that wasn't your question ;-) – Chris Huang-Leaver Aug 15 '10 at 7:24
  • 2
    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]: monodevelop.com – bitek 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
  • 1
    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

Using the Java example from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting, 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 " +$"

Duplicated here: https://askubuntu.com/questions/2163/nano-syntax-highlighting-for-c-and-or-asp-net

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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