Re: Auto-increase indent

2019-02-13 Thread Christopher Stone
On 02/12/2019, at 21:30, Ehler mailto:lurkingintheshadowsb...@gmail.com>> wrote:
> I'm very new to using BBEdit but love a lot of things about it! I'm hoping to 
> mimic a feature from Sublime Text that increases the indent contextually 
> based on what you're doing with the code. Here's an example in JavaScript (I 
> don't claim to know anything)


Hey Ehler,

I doubt we'll see behavior like that from BBEdit any time soon, but please do 
make a feature request to the support address (see message footer).

The first thing to try out is a clipping:


function <#function name#>(<#args#>) {
<#code#>
return false;
}


Paste this into BBEdit – you can then tab between the tokenized arguments.

(See Clippings in the BBEdit user manual.)

** I'm not sure if BBEdit has JavaScript clippings by default, but I think it 
does.  Yeah, it's in the BBEdit 9 Default Clippings set.

http://www.barebones.com/support/bbedit/clippings_library.html 


http://bbeditextras.org/wiki/index.php?title=Clippings 



Type the following:

function betterOffFred(shirt) {Cmd-O, Cmd-O, Cmd-N, Tab, console.log("I'm too 
sexy for my" + shirt)

(Cmd-Letter-O - not zero.)

Make sure the Emulate Emacs key bindings setting is ON in the BBEdit Keyboard 
Preferences:



You may find BBEdit's clippings do the trick.

You may want to create fantastic smart-workflows with AppleScript.

You may want to consider a clippings utility that has GUI capabilities like 
Typinator .

In any case – many exciting things are possible.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: distraction free

2019-02-13 Thread David Rostenne
Hi Keith..

Do file it as a bug.. either the app is broken or the dictionary needs updating!

Cheers,

Dave

> On 11-February-2019, at 2:08 PM, Keith Irwin  wrote:
> 
> Here’s mine so far:
> 
> tell application "BBEdit"
>   activate
>   try
>   set win to text window 1
>   tell win
>   set show gutter to false
>   set show navigation bar to false
>   set smart quotes to true
>   set sidebar visible to false
>   set show line numbers to false
>   set soft wrap width to 80
>   set soft wrap text to true
>   set soft wrap mode to window width
>   set display magnification to 1.25
>   end tell
>   on error str
>   display alert str
>   end try
> end tell
> 
> A bit of redundancy with activate and setting a win variable, but this is 
> where I left off. I have other scripts for other modes so I don’t worry about 
> toggles in this case.
> 
> Do you think we should report the show status bar property as a bug?
> 
> Keith
> 
>> On Feb 11, 2019, at 6:42 AM, David Rostenne  wrote:
>> 
>> Funny you should ask this as I was looking at someone else’s script to do 
>> just this.. and also ran into issues. The script:
>> 
>> tell application "BBEdit"
>>  tell window 1
>>  set show line numbers to (not show line numbers)
>>  set show gutter to (not show gutter)
>>  set show navigation bar to (not show navigation bar)
>>  -- set show status bar to false
>>  set sidebar visible to false
>>  end tell
>> end tell
>> 
>> If I uncomment the ‘show status bar’ line and run it I get:
>> 
>> error "BBEdit got an error: An unexpected error occurred while processing an 
>> Apple Event (macOS error code: -1)." number -1
>> 
>> I use get statements to test with and getting status bar works fine.. but 
>> changing it fails.
>> 
>> Can you share your script? I’m interested in setting up a distraction free 
>> writing mode as well.
>> 
>> Cheers,
>> 
>> Dave
>> 
>>> On 10-February-2019, at 1:35 AM, Keith Irwin  wrote:
>>> 
>>> I thought I’d write a little script to set BBEdit into distraction free 
>>> mode:
>>> 
>>> So far I can:
>>> 
>>> - Hide the nav and gutter and sidebar line numbers
>>> - Set the wrap mode I like
>>> - Set magnification, smart quotes, etc
>>> 
>>> via AppleScript.
>>> 
>>> However, I can’t:
>>> 
>>> - hide the text status bar (the bottom thing), 
>>> - or the right-side scroll bar.
>>> 
>>> - The Text Window properties have a “show status bar” prop — setting this 
>>> generates an error.
>>> 
>>> - Prefs -> Appearance -> Text Status Bar: unchecking all works — 
>>> AppleScript accessible?
>>> 
>>> Question: Is there a way to revert the right-side scroll bar to “auto hide” 
>>> like all the other windows on macOS? (I tried unchecking 'show spelling' or 
>>> ‘find' ticks — no go. Couldn’t find an Expert Pref for it either.)
>>> 
>>> Question: Is there a way to change preferences via AppleScript? Do I need 
>>> to use System Events with key commands or guess property names? (They don’t 
>>> show up in Script Debugger’s explorer or object model).
>>> 
>>> Thanks for any help!
>>> 
>>> Keith
>>> version 12.6 (412025, 64-bit, sandboxed)
>>> 
>>> -- 
>>> This is the BBEdit Talk public discussion group. If you have a 
>>> feature request or need technical support, please email
>>> "supp...@barebones.com" rather than posting to the group.
>>> Follow @bbedit on Twitter: 
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "BBEdit Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to bbedit+unsubscr...@googlegroups.com.
>>> To post to this group, send email to bbedit@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/bbedit.
>> 
>> -- 
>> This is the BBEdit Talk public discussion group. If you have a 
>> feature request or need technical support, please email
>> "supp...@barebones.com" rather than posting to the group.
>> Follow @bbedit on Twitter: 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BBEdit Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to bbedit+unsubscr...@googlegroups.com.
>> To post to this group, send email to bbedit@googlegroups.com.
>> Visit this group at https://groups.google.com/group/bbedit.
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or need technical support, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> --- 
> You received this message because you are subscribed to the Google 

Re: Auto-increase indent

2019-02-13 Thread @lbutlr
On 12 Feb 2019, at 20:30, Ehler  wrote:
> I'm very new to using BBEdit but love a lot of things about it! I'm hoping to 
> mimic a feature from Sublime Text that increases the indent contextually 
> based on what you're doing with the code.

I don;'t know sublime or what exactly "indent contextually" means there, but if 
I type

function test ()
   {
  line one

then at the end of line one, when I hit return, the cursor is under the 'l' 
character of line one. If I backspace, I get the cursor under the {


-- 
Bishops move diagonally. That's why they often turn up where the kings
don't expect them to be.



-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: distraction free

2019-02-13 Thread @lbutlr
On 12 Feb 2019, at 16:27, Keith Irwin  wrote:
> Do you know of a way to make the right-side scrollbar on the editor “auto 
> hide” like all the other scrollbars in desktop apps?

Maybe check the thread. I was simply responding to the "Do you think we should 
report the show status bar property as a bug?" with some supporting 
documentation from the manual.

Or, to put it another way, i have no dog in this hunt.

-- 
We are born naked, wet and hungry; then it's all downhill.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: distraction free

2019-02-13 Thread Keith Irwin
Hello @lbutlr —

The issue here is to write a script that will automatically hide the text 
status bar:

- There’s no UI for that (except clearing all text status bar prefs as you 
mentioned).

- There IS mention of a “status bar” (not “text status bar”) in the AppleScript 
dictionary for the app, but setting it generates an error.

- I can’t find any mention of text status bar or its properties in the 
AppleScript dictionary for BBEdit.

I’m okay with the idea of clearing all the preferences for “text status bar” in 
order to hide it, but I can’t see a way to do that via AppleScript. Do you?

For instance, are all preferences for all AppleScript enabled apps available as 
a dictionary somewhere non-obvious (to newbie me)?

Aside from all that:

- Do you know of a way to make the right-side scrollbar on the editor “auto 
hide” like all the other scrollbars in desktop apps?

Keith



> On Feb 12, 2019, at 4:03 AM, @lbutlr  wrote:
> 
> On 11 Feb 2019, at 12:08, Keith Irwin  wrote:
>> Do you think we should report the show status bar property as a bug?
> 
> I do not see a "status bar" setting in the BBEdit menus. Is it no longer 
> there or is it supposed to be part of AppleScript only?
> 
> It's definitely in the manual:
> 
> p. 212: Text Status Bar
> 
> When any of the listed options are on, BBEdit displays the status bar (see 
> page 84). You can show or hide the status bar independently for each text 
> window.
> 
> I don't see it mentioned at all on page 84.
> 
> p. 87
> 
> You can use the options in the Status Bar group of the Appearance preference 
> panel to hide or show individual items on the status bar, and if you disable 
> these options, BBEdit will hide the status bars.
> 
> The list of items is:
> 
> Cursor Position
> Language
> Text Encoding
> Line Break Type
> Document Lock State
> Document Statistics
> Magnification
> 
> 
> (BBEdit 12.5.2 and the BBEdit manual v 12.5)
> 
> -- 
> Rincewind had always been happy to think of himself as a racist. The
> One Hundred Meters, the Mile, the Marathon -- he'd run them all.
> 
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or need technical support, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Auto-increase indent

2019-02-13 Thread Ehler
I'm very new to using BBEdit but love a lot of things about it! I'm hoping 
to mimic a feature from Sublime Text that increases the indent contextually 
based on what you're doing with the code. Here's an example in JavaScript 
(I don't claim to know anything)

Here's what it looks like in Sublime Text 

Here's what it looks like in BBEdit doing the same things 


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: A little grep help

2019-02-13 Thread @lbutlr
On 13 Feb 2019, at 00:43, Christopher Stone  wrote:
> That has to be a typo on your friend's part.  There's no sense in adding a 
> capture for an optional literal 'm' – it adds nothing and can mangle words 
> ending in 'm'.

Yep, none of the input I was testing had words ending in m, evidently. This, of 
course, only added to my confusion as to what this was doing and why it worked!


-- 
Well boys, we got three engines out, we got more holes in us than a
horse trader's mule, the radio is gone and we're leaking fuel and if we
was flying any lower why we'd need sleigh bells on this thing... but we
got one little budge on those Roosskies. At this height why they might
harpoon us but they dang sure ain't gonna spot us on no radar screen!




-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.