How to actually set an expert preference?

44 views
Skip to first unread message

David G Wagner

unread,
Jun 15, 2020, 9:11:28 AM6/15/20
to BBEdit Talk
I looked at the doc and did some searches on the net and either I used the wrong wording or did not view the right outputs, but I never did see how one is to set a particular expert preference or see what expert preferences are set.

I tried a shell worksheet and executed ’env’ and got the output back. But never understood how to set a preference or see what others are set.

Any examples or if in doc, point me to it...

Thanks... ;)

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391

Sam Hathaway

unread,
Jun 15, 2020, 9:25:10 AM6/15/20
to BBEdit Talk

Wags,

The Expert Preferences page in BBEdit’s “built-in Help book” shows the command to enter for each setting. (Help > BBEdit Help > Expert Preferences)

These commands are to be entered in the Terminal. They do not set environment variables so env will not help you here. For more information on macOS’s defaults system, run man defaults in the Terminal.
-sam

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/278792e9-9922-4b15-ac3f-ac6b0ee949a1%40Spark.

Bruce Van Allen

unread,
Jun 15, 2020, 10:32:16 AM6/15/20
to bbe...@googlegroups.com
Hey David,

As Sam just mentioned, special preference commands are usually
executed on the command line (i.e., in the Terminal for most Mac users).

A few more tips:

1. As I've learned useful expert prefs, I collect them together
in a set of shell worksheets, one sheet each for BBEdit, other
apps, and the OS itself. Then when I want to evoke a specific
one, I only select that line of the worksheet, and hit Enter or
my current key-combo to execute.

Here's an entry on my BBEdit Prefs worksheet:
# Include delimiters in balance command
defaults write com.barebones.bbedit BalanceIncludesDelimiters
-bool YES
defaults write com.barebones.bbedit BalanceIncludesDelimiters
-bool NO
defaults read com.barebones.bbedit BalanceIncludesDelimiters

Of these three, use only one at a time, to set, un-set, or read
out the setting.

2. That latter is the answer to one of your questions. If you
use the command 'read' instead of 'write', the current setting
for that default pref will print out.

So if I select and hit Enter to execute the third command above
defaults read com.barebones.bbedit BalanceIncludesDelimiters
the output is 0 (zero) because I previously executed the pref
with -bool NO. That works in the Terminal, too, of course.

3. Some commands require root permissions, so on the Terminal
you'd precede the pref command with 'sudo'

# Make finder show User's Library directory
sudo chflags nohidden ~/Library

But worksheets aren't interactive, so when you get prompted for
your password, you can't enter it and continue. The two
solutions I've used:
* simply copy the pref command from the worksheet collection
and paste it in into a Terminal and press Enter;

* Take the more complex step of setting oneself (admin Mac
user) as a "sudoer" who can use sudo without having to enter
their password each time. This is a bit complicated, and I'm not
going to put the instructions here. (Ask and I will.)

HTH

On 6/14/20 at 7:38 PM, wagsw...@gmail.com (David G Wagner) wrote:

>I looked at the doc and did some searches on the net and either I used
>the wrong wording or did not view the right outputs, but I never did
>see how one is to set a particular expert preference or see what
>expert preferences are set.
>
>I tried a shell worksheet and executed ’env’ and got the output back.
>But never understood how to set a preference or see what others are
>set.
--

- Bruce

_bruce__van_allen__santa_cruz__ca_

Rich Siegel

unread,
Jun 15, 2020, 10:50:41 AM6/15/20
to bbe...@googlegroups.com
On 6/15/20 at 10:32 AM, b...@cruzio.com (Bruce Van Allen) wrote:

>3. Some commands require root permissions, so on the Terminal you'd precede the pref command with 'sudo'
>
># Make finder show User's Library directory
>sudo chflags nohidden ~/Library
>
>But worksheets aren't interactive, so when you get prompted for
>your password, you can't enter it and continue.

Try it. :-) If `sudo` requires your password during a worksheet
interaction, BBEdit will prompt you.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

Bruce Van Allen

unread,
Jun 15, 2020, 11:17:41 AM6/15/20
to bbe...@googlegroups.com
On 6/15/20 at 7:50 AM, sie...@barebones.com (Rich Siegel) wrote:

>Try it. :-) If `sudo` requires your password during a worksheet
>interaction, BBEdit will prompt you.

I forgot that!

Thanks,
--

- Bruce

_bruce__van_allen__santa_cruz__ca_

Patrick Woolsey

unread,
Jun 15, 2020, 1:13:47 PM6/15/20
to bbe...@googlegroups.com
On 6/14/20 at 10:38 PM, wagsw...@gmail.com (David G Wagner) wrote:

>I looked at the doc and did some searches on the net and either I used the wrong wording or did not view the right outputs, but I never did see how one is to set a particular expert preference or see what expert preferences are set.
>

Please see the "BBEdit Expert Preferences" page:

<https://www.barebones.com/support/bbedit/ExpertPreferences.html>

In particular, I suggest you read the initial "Note", while
beyond that, each option includes a Terminal command that you
may run[*] to obtain the desired behavior.


[*: In most cases, you need only copy & paste the provided
command into the Terminal, though a few options contain
placeholders that you'll need to replace with actual info before running.]


Regards

Patrick Woolsey
==
Bare Bones Software, Inc. <https://www.barebones.com/>

F. Alfredo Rego

unread,
Jun 15, 2020, 6:19:36 PM6/15/20
to BBEdit Talk
# Cool-O.

Now, for the 64k: Is there a shortcut to see the current settings for ALL expert preferences?

Something along the lines of "defaults read com.barebones.bbedit all” ?

Thanks.

Alfredo

Patrick Woolsey

unread,
Jun 15, 2020, 6:35:19 PM6/15/20
to bbe...@googlegroups.com
On Jun 15, 2020, at 18:19, F. Alfredo Rego <F.Alfr...@gmail.com> wrote:
>
> Now, for the 64k: Is there a shortcut to see the current settings for ALL expert preferences?
>
> Something along the lines of "defaults read com.barebones.bbedit all” ?
>

There is no specific shortcut to display only the documented expert prefs.

One can however read _all_ of BBEdit's prefs via the 'defaults' command, though I strongly encourage anyone who does so to exercise due caution -- if you jump head first into the quicksand, we can always get you back out but you may not enjoy the experience! ;-)


Regards,

F. Alfredo Rego

unread,
Jun 15, 2020, 7:40:50 PM6/15/20
to BBEdit Talk
Intriguing. From the man page:

BUGS
     Defaults can be structured in very complex ways, 
     making it difficult for the user to enter them with this command.

Gulp ;-)

Alfredo

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
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+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages