in reply to Re: prettyfy hashes
in thread prettyfy hashes

> In Emacs, you can use align-regex , which I usually bind to C-x l . I can then just select the region and press C-x l => Enter and voilą!

There is room for much improvement...

1. selecting the region:

a combination of backward-up-list and mark-sexp will select the surrounding structure (repeating will extend the selection till statement (ie. ';') boundary.

(please note that cperl-mode injects here some semantic knowledge about the code's structure which can't be reflected in a simple regexp rule)

2. the rule for align-current has the advantage to harmonize the surrounding whitespaces too. And align-regexp seems to allow the same extended logic.

So combining both steps bound to a key should make alignment of fat-commas quite easy.

I experimented with a kmacro and it seemed quite nice. :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!