Ruby Syntax Highlighter for Nano

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Ruby Syntax Highlighter for Nano

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

--
Posted via http://www.ruby-forum.com/.

Reply | Threaded
Open this post in threaded view
|

Re: Ruby Syntax Highlighter for Nano

Bugzilla from m.fellinger@gmail.com
Hey Jason,

Good work... i've searched for it too, but after looking through the existing
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
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby Syntax Highlighter for Nano

Ryan Sobol
In reply to this post by Jason Jung
On Dec 24, 2005, at 1:36 AM, Jason Jung wrote:

> 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
>
> --
> Posted via http://www.ruby-forum.com/.
>

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 "'[^']*'"

Reply | Threaded
Open this post in threaded view
|

Re: Ruby Syntax Highlighter for Nano

Jason Jung
Version 0.8.1
Added Ryan Sobol's suggestion

http://jungsource.pastebin.com/477686

On 12/24/05, J. Ryan Sobol <[hidden email]> wrote:

> On Dec 24, 2005, at 1:36 AM, Jason Jung wrote:
>
> > 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
> >
> > --
> > Posted via http://www.ruby-forum.com/.
> >
>
> 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 "'[^']*'"
>
>


--
@(*o*)@