toward balanced and colorful delimiters



Emacs has the very useful feature of blinking the corresponding left "(" when
you type its partner ")" (and the same for other delimiters like "[]", "{}"
etc., depending on the mode). This is very useful for programming, especially
for languages like Lisp and Scheme and the like.





Further help can come from tools like autopair or paredit – although the
latter is a bit too much bondage & discipline for me, many people love it.


Anyway, recently I discovered a new helper in the quest for balance in
delimited universe: rainbow-delimiters. With this package, the delimiters all
get different colors based on their nesting level. It works wonderfully well.


Installation is straightforward:



  • download rainbow-delimiters and put it in your load-path

  • add something like the following in your .emacs:


(when (require 'rainbow-delimiters nil 'noerror) 
(add-hook 'scheme-mode-hook 'rainbow-delimiters-mode))

That's it – of course you'll need to do the equivalent for modes where you'd
like to enable it. See the screenshot below – maybe a bit too colorful for
some people, but I like it and I have found it actually useful to see the
corresponding delimiters without having to move the cursor over them.







I already added some nice Zenburn colors for this to the Zenburn theme for Emacs-24, as can be seen in the screenshot.


No comments:

Post a Comment

Followers

Popular Posts