|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
[emacs] automatically indent to comment-columnby LanX (Saint) |
| on May 10, 2010 at 11:30 UTC ( #839203=CUFP: print w/replies, xml ) | Need Help?? |
|
Hi the following emacs lisp code makes typing # DWIM. At the "end" of a perl code line it will automatically indent to the comment-column. Example typing ..."huhu";#the hash... will produce this indentation: The code is work in progress if you find bugs feel free to reply here. Plz note I also bound C-# to what normally M-; does, because it's much easier to reach on QWERTZ keyboards and IMHO more intuitive in Perl context. Additionally this command will also automatically comment/uncomment selected text. UPDATE: You have the choice between different levels of aggressiveness, ATM the command checks¹ if the hash doesn't follow a blacklist of chars (actually $). You can change this behaviour to more restrictive whitelisting by uncommenting the following line (i.e. has to follow ; { ( [) Cheers Rolf
Back to
Cool Uses for Perl
|
|
||||||||||||||||||||||||||||||