In the spirit of sharing again, I've written some macros with Keyboard 
Maestro that try to emulate Textmate's Auto-pairing / matching. 

Details in my blog post 
: 
http://journal.kaush.co/453/true-textmate-like-auto-pairing-with-bbedit-using-keyboard-maestro

Cheers.

On Tuesday, July 27, 2010 10:34:54 AM UTC+3, Roland Küffner wrote:
>
>
> Am 27.07.2010 um 03:54 schrieb Toadling:
>
> > On Jul 16, 2010, at 5:47 AM, Konstantinos Pachnis wrote:
> > 
> >> In TextMate there is feature Column Movement / Typing that you can 
> select a column data and then start typing to type on each line. Can this 
> be done in BBEdit?
> > 
> > I think the closest you'll get to that in BBEdit is the "Text -> 
> Prefix/Suffix Lines..." command. Assign a key combination to it and trigger 
> it to bring up a sheet with options to add or remove prefixes and suffixes 
> for all selected lines.
>
> > Additional you can make a rectangular selection in BBEdit (hold Alt 
> while selecting, make sure Soft Wrap is turned off) and paste the content 
> of the clipboard to each line at the selected position. Again, this is not 
> as fancy as in TextMate but does the job.
>
>
> >> When I select a string (word, line, etc…) can I enclose it in between 
> parentheses, quotes, square brackets, etc… by just typing the character?
> >> Using a language mapping (ruby, c++, etc…), is it possible when opening 
> a parentheses, square bracket, etc… to insert the corresponding close 
> character?
> > 
> > The best way I've found to simulate this behavior is to use BBEdit's 
> clippings feature. I created a bunch of clippings to insert the opening and 
> closing characters with the cursor positioned between them (and any other 
> text I want). I then assigned keyboard shortcuts to them. For example, 
> Control-Command-[ gives me a pair of square brackets with my cursor in 
> between ready for input.
> > 
> > Again, maybe not as fancy as TextMate's auto-matching pairs, but I do 
> find I get fewer accidental, unwanted closing parens and brackets with the 
> clipping method in BBEdit.
>
>
> Be sure to check out the Clipping feature in the manual. It is one of 
> BBEdit's best features. You would miss a lot of functionality that makes 
> BBEdit such a decent editor. For example the syntax for adding 
> parenthesises to a selection is:
> #selstart#(#select#)#selend#
> With an assigned keyboard shortcut this is pretty nice. You can further 
> tweak BBEdit with little applescripts that make your editing life easier. 
> One of my favorites is "Select Word" (by John Gruber if I remember that 
> right):
>
> tell application "BBEdit"
>         tell window 1
>                 set sel_offset to characterOffset of selection
>                 set cur_line to startDisplayLine of selection
>                 try
>                         select (last word of display_line cur_line ¬
>                                 whose characterOffset ≤ sel_offset)
>                 on error
>                         select display_line cur_line
>                 end try
>         end tell
> end tell
>
>
> This group is a good ressource for little bits. You'll find a lot of 
> solution to specific problems. Searching the archives is strongly 
> recommended.
>
> Happy editing
> Roland
>
>

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to