3

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

tshepang
  • 64,472
  • 86
  • 223
  • 290
Rob Cowell
  • 322
  • 3
  • 8
  • There is an emacs one, but that wasn't your question ;-) – Chris Huang-Leaver Aug 15 '10 at 07: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]: http://monodevelop.com/ – Alex 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](http://area51.stackexchange.com/proposals/18782/developer-tools?referrer=-bI3FcA1Z2M1Ef1WF8pECg2) 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 Answers2

3

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 " +$"
Monoman
  • 244
  • 1
  • 3
-1

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

tlvince
  • 1,156
  • 1
  • 8
  • 11