tags:

views:

21

answers:

2

Hi, is there an easy way within TextMate that I can select a string, hit some key and magically it will surround the string with double quotes.

For example:

 I have some text here

I select this text, use some command sequence and I have:

 "I have some text here"
+1  A: 

Sure! once you have selected the text, the key is "

hellvinz
give me the big "duh" award, I tried 10 different combinations of things, but never the obvious
Joelio
interesting this works for single and double quotes, but not for parens and brackets.
Joelio
It should indeed work for parens and brackets.
David M.
There's a chapter about this in the manual: http://manual.macromates.com/en/working_with_text.html#auto-paired_characters_quotes_etc
hellvinz
A: 

Handy extra tip: don't miss Ctrl-Shift-' (that is, Ctrl-") to toggle the quotes surrounding the cursor from single to double quotes.

David M.