Ruby Syntax Highlighter for Nano

J

Jason Jung

I spent around an hour looking for a Ruby syntax highlighter for Nano.
I couldn't find one so I decided to try my best at creating my own. If
anyone has any suggestions or wants to help improve it, be my guest.

Get it here: http://jungsource.pastebin.com/477379

To install:
Copy and add all of the text from pastebin to the bottom of ~/.nanorc
If .nanorc does not exist create it.

Nanorc doc - http://www.nano-editor.org/dist/v1.2/nanorc.5.html

Note: Tested using Nano 1.2.4 in Fedora Core 3 Linux
 
M

Michael Fellinger

--nextPart2553857.krYplLMDNQ
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hey Jason,

Good work... i've searched for it too, but after looking through the existi=
ng=20
styles i decided it's not worth the effort and switched to vim instead...
However, nano has been/and for really quick editing still is, my favorite=20
editor.

thx a lot for your effort :)

~~~~ manveru

Am Samstag, 24. Dezember 2005 07:36 schrieb Jason Jung:
I spent around an hour looking for a Ruby syntax highlighter for Nano.
I couldn't find one so I decided to try my best at creating my own. If
anyone has any suggestions or wants to help improve it, be my guest.

Get it here: http://jungsource.pastebin.com/477379

To install:
Copy and add all of the text from pastebin to the bottom of ~/.nanorc
If .nanorc does not exist create it.

Nanorc doc - http://www.nano-editor.org/dist/v1.2/nanorc.5.html

Note: Tested using Nano 1.2.4 in Fedora Core 3 Linux

--nextPart2553857.krYplLMDNQ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBDrSQ5MdQeL6eBxhIRAiENAKDXFAKhCAYcNrV8sYC9gSwI2Qq16ACgkRz1
Xujb4lpNlStsTUf0R8dMrMc=
=YQB0
-----END PGP SIGNATURE-----

--nextPart2553857.krYplLMDNQ--
 
J

J. Ryan Sobol

I spent around an hour looking for a Ruby syntax highlighter for Nano.
I couldn't find one so I decided to try my best at creating my
own. If
anyone has any suggestions or wants to help improve it, be my guest.

Get it here: http://jungsource.pastebin.com/477379

To install:
Copy and add all of the text from pastebin to the bottom of ~/.nanorc
If .nanorc does not exist create it.

Nanorc doc - http://www.nano-editor.org/dist/v1.2/nanorc.5.html

Note: Tested using Nano 1.2.4 in Fedora Core 3 Linux

One quick edit to your script.

If you swap the following two segments, the highlighter won't think "#
{expression}" is a comment.

# Words in Quotes
#color green ""[^\"]*""
color green ""[^"]*"|qq\|.*\|"
color green "'[^']*'"

# Comments
color brightyellow "#.*"


TO

# Comments
color brightyellow "#.*"

# Words in Quotes
#color green ""[^\"]*""
color green ""[^"]*"|qq\|.*\|"
color green "'[^']*'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top