Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get TextMate style quotes in Emacs?

Tags:

emacs

In textmate, when there's a current selection, I hit the " key and the selection gets surrounded by quotes. The same thing happens with other balanced characters like (, {, [ and '.

Am I missing something obvious in Emacs configuration that would enable similar behaviour when using transient mark mode, or do I need to break out elisp and write something?

like image 238
Piers Cawley Avatar asked Sep 16 '08 14:09

Piers Cawley


2 Answers

wrap-region.el from this guy's blog post will do what you're looking for.

Paredit will complete the TextMate-style quoting. When you type one part of a matched pair (quotes, brackets, parentheses, etc), the second will be inserted and the insertion point is moved between them, much like TextMate.

like image 124
Clinton Dreisbach Avatar answered Oct 17 '22 16:10

Clinton Dreisbach


Try http://autopair.googlecode.com

like image 32
Joao Tavora Avatar answered Oct 17 '22 18:10

Joao Tavora