Ruby Syntax Highlighter for Nano

Discussion in 'Ruby' started by Jason Jung, Dec 24, 2005.

  1. Jason Jung

    Jason Jung Guest

    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/.
    Jason Jung, Dec 24, 2005
    #1
    1. Advertising

  2. --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--
    Michael Fellinger, Dec 24, 2005
    #2
    1. Advertising

  3. 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 "'[^']*'"
    J. Ryan Sobol, Dec 24, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nano
    Replies:
    0
    Views:
    406
  2. Lee Harvey
    Replies:
    1
    Views:
    494
    Adrienne
    Jul 28, 2003
  3. Mike Schwab

    highlighter for operator precedence

    Mike Schwab, Apr 19, 2007, in forum: Ruby
    Replies:
    1
    Views:
    78
    Robert Klemme
    Apr 20, 2007
  4. Simon

    Javascript Highlighter

    Simon, Jul 29, 2003, in forum: Javascript
    Replies:
    2
    Views:
    84
    Simon
    Jul 30, 2003
  5. Une Bévue

    online syntax highlighter

    Une Bévue, Mar 2, 2007, in forum: Javascript
    Replies:
    7
    Views:
    117
    Lorenzo Bettini
    Mar 13, 2007
Loading...

Share This Page