In Emacs, toggle ruby hash syntax between classic and 1.9 styles
Emacs Lisp
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
ruby-hash-syntax.el

README.md

Melpa Status Melpa Stable Status Support me

ruby-hash-syntax.el

Adapted from the method used by TextMate, this library provides a command ruby-hash-syntax-toggle which attempts to automatically convert the selected region of ruby code between 1.8 and 1.9 hash styles.

Installation

If you choose not to use one of the convenient packages in MELPA, you'll need to add the directory containing ruby-hash-syntax.el to your load-path, and then (require 'ruby-hash-syntax).

Usage

Add the following to your emacs init file:

(require 'ruby-hash-syntax)

Then select a block of ruby code containing a hash literal (perhaps using mark-sexp), and run the ruby-hash-syntax-toggle command:

M-x ruby-hash-syntax-toggle

You might like to bind that command to a key in ruby-mode-map.


Steve Purcell's blog // @sanityinc on Twitter