Hi,
How can you make it so when you press a '(' when editing source-code '( )' is inserted instead of '()', that is, there are two spaces between the brackets and the cursor is in-between those two spaces? It makes code much easier to read.
Thanks!
P.S. Sorry if this message shows up as a duplicate.
Just record a macro with ( ) and set it for ( and whatever scope if appropriate. thomas Aylott — subtleGradient — CrazyEgg — bundleForge
On Aug 19, 2007, at 4:56 PM, squirrelturtle wrote:
Hi,
How can you make it so when you press a '(' when editing source-code '( )' is inserted instead of '()', that is, there are two spaces between the brackets and the cursor is in-between those two spaces? It makes code much easier to read.
Thanks!
P.S. Sorry if this message shows up as a duplicate.
View this message in context: http://www.nabble.com/Auto-Paired-with-Spaces-tf4295400.html#a12226736 Sent from the textmate users mailing list archive at Nabble.com.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Aug 19, 2007, at 4:56 PM, squirrelturtle wrote:
How can you make it so when you press a '(' when editing source- code '( )' is inserted instead of '()', that is, there are two spaces between the brackets and the cursor is in-between those two spaces? It makes code much easier to read.
I made a snippet with ( for a tab trigger. It inserts "( $0 ". So if you hit ⇥ inside the parentheses, it spaces them out and leaves the cursor in the middle. Remembering to hit ⇥ is a pain, but it works.
I used to have empty parentheses defined as its own scope and could then change the behavior of the space bar in that scope, which made it more natural, but it was a pain to define this scope in any language I wanted to use it in (and repeat the process when those languages were updated).
Hopefully one day you'll be able to define this "spacing out" behavior the same way indentation is done automatically when you hit ↩ inside {}, for example.
--- Rob http://www.skurfer.com/