> I use Ultraedit quite a bit when I have to use Windows, and even Vim
> offers a really good feature whereby you position your cursor to the
> left or right (depending on whether or not there are other
> parentheses) or a bracket, and it highlights the opening and closing.
View -> Balance.
Or double-click on a parenthesis, brace, or bracket.
R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>
Someday I'll look back on all this and laugh... until they sedate me.
> I've noticed that BBedit goes someway towards this, when you write a
> new block and then close it, it will highlight the opening bracket.
> But this needs to persist so one can scroll up the page without losing
> focus.
cmd-B (Balance in the View menu) will select the contents of the pair
of delimiters the insertion point currently sits in between. Balance &
Fold in the same menu may also be of use.
Hope this helps,
Maarten
> On 7/1/08 at 7:23 AM, tom.l...@gmail.com (shoez) wrote:
>
>> I use Ultraedit quite a bit when I have to use Windows, and even Vim
>> offers a really good feature whereby you position your cursor to the
>> left or right (depending on whether or not there are other
>> parentheses) or a bracket, and it highlights the opening and closing.
>
> View -> Balance.
>
> Or double-click on a parenthesis, brace, or bracket.
>
> R.
It would be great if other delimiters could be added such as < and >, and
even selecting text between two (non-curly) apostrophes, with or without the
apostrophes.
And while we are at it ;-) some easy means to select "$varname" including
the $.
Regards
Roddie Grant
Errr... , all of these things can be done pretty easily with the
existing search features (and maybe a bit of AppleScript) if you so
desire...
(What I wouldn't want is every little feature being added as an
explicit and inflexible menu option when the ability is already there
is a totally open form...)
I quite agree with the last point. Too many things means you miss them -
like the OP and View->Balance.
In these days of XML I'm always surprised the there isn't Balance for < and
> as they work much like brackets. Though I suppose in inequalities one can
appear without its counterpart which might be a complication.
If you can point me to a quick way of selecting "$abc" or "#FFCC66" I'd be
delighted. Learning AppleScript is on my ToDo list but at the moment it's
not a priority.
Thanks
Roddie Grant
In html and xml mode, the balancing distinguishes between the type of
the tags:
<p> balances with </p>, but not with </b>. I think that is even better.
Maarten
Roddie,
Just quickly, searching using grep is your answer.
\$.+?\b will match variables like $abc, $variable, etc.
#[A-F0-9]{6} will match hex colour codes (using capitals).
The BBEdit Manual and Help has **excellent** guides to using grep.
Hope this helps.
Regards
Carlton
Hi Carlton
Thanks for your help with this; grep is invaluable. What I was looking for
was a quick way to select with the mouse or a simple keystroke - like
double-click selects the word (but not the $ or #) and triple-click selects
a line or like Cmd-B selects from bracket to bracket.
This is not of major importance - my first post was only an "Ooh yes! It
would be nice if...", but I'm always ready to learn more efficient ways of
working.
Regards
Roddie
> Applescript can be your friend on this. With the recording feature in
> BBEdit's script menu you can easily mimicry missing features without
> having to dig too deep into Applescript. I did this on exactly that
> "Select text between string"-example.
>
> Here is the script (not sure if the linebreaks survive this posting
> from Googles webfrontend correctly, so watch out):
>
> tell application "BBEdit"
> find "(\"|')" searching in text 1 of text document 1 options {search
> mode:grep, starting at top:false, wrap around:false, backwards:true,
> case sensitive:false, match words:false, extend selection:false} with
> selecting match
> set daString to (grep substitution of "\\1")
> select insertion point after selection
> set theStart to characterOffset of selection
> find daString searching in text 1 of text document 1 options {search
> mode:grep, starting at top:false, wrap around:false, backwards:false,
> case sensitive:false, match words:false, extend selection:false} with
> selecting match
> select insertion point before selection
> set theEnd to (characterOffset of selection) - 1
> select characters theStart through theEnd of text 1 of text document
> 1
> end tell
Brilliant!
I'm going to have to give learning AppleScript more priority.
Thanks
Roddie Grant
Exactly the right reasoning. :-)
If you're basically using AppleScript just to automate tasks you'd do
with other BBEdit commands (like perform the kind of grep search we
talked about) then the AppleScript chapter in the BBEdit manual
contains all you need to get started.
Good luck.
Carlton
If you double-click on a word and hold the "mouse" button down after
the second click, you can move the cursor left or right to pick up
the next "word".
So if you do this to #FFCC66, you will select FFCC66 first, then
moving left it will pick up the # and so on.
--
Good friends are hard to find, harder to leave, and impossible to forget.
Bill Verity - 814-865-4758 Fax: 814-863-7049
204S Wagner Building - Information Technology Services, Penn State University
At the office - on my Mac, of course ;-)