Documentation on directory-specific settings?

46 views
Skip to first unread message

Adam Franco

unread,
Nov 10, 2010, 10:23:08 AM11/10/10
to BBEdit Talk
The 9.6 release notes mention that:

"BBEdit now supports directory-specific settings. To use these, write
a well-formed INI file, whose keys and values are the same format as
those in ~/.bbedit. The file may be named anything, as long as its
name ends in ".bbeditSettings". The settings specified in that file
will override all others and will apply to any file that is opened
from the same directory as the settings file, as well as any file
opened from a subdirectory of the settings file."

I can't seem to find any documentation on the "~/.bbedit" options
available or how I might find an example of one (one doesn't exist on
in my home directory). Any pointers to documentation would be helpful.

In case there isn't good documentation, my particular goal is to leave
my tab-width at 4 spaces and use tabs as my default (my current
settings), but for a particular project directory only (a Drupal
directory) to use a tab-width of 2 spaces and auto-expand tabs. What
should I put in the .bbeditSettings file for this project to achieve
these results?

Thanks for any help you can give!

Adam

Rich Siegel

unread,
Nov 10, 2010, 10:37:54 AM11/10/10
to bbe...@googlegroups.com
On Wednesday, November 10, 2010, Adam Franco <adamf...@gmail.com>
wrote:

>I can't seem to find any documentation on the "~/.bbedit" options
>available or how I might find an example of one (one doesn't exist on
>in my home directory). Any pointers to documentation would be helpful.

INI-style preferences were introduced in BBEdit 9.2. If you go
to the omnibus BBEdit 9 notes at
<http://www.barebones.com/support/bbedit/arch_bbedit9.html> and
search for "~/.bbedit", you'll find information about the file
format, and in the section following, more about
directory-specific prefs.

Enjoy,

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.

Adam Franco

unread,
Nov 10, 2010, 11:42:15 AM11/10/10
to BBEdit Talk
Thanks for the help, Rich -- I'm now part way there.

I have a test directory with the following structure which is
partially making use of changes in the .bbeditSettings file:

test/
drupal.bbeditSettings
subdir/
test2.php
test.php

And the contents of my drupal.bbeditSettings file is:

[Editor]
AutoExpandTabs = 1
DefaultTabWidth = 2

[HTMLTidy]
TidySpacesPerTab = 2

[TabConversion]
DetabWidth = 2
EntabWidth = 2


At this point if I open test.php or subdir/test2.php each file will be
opened with AutoExpandTabs on. Hitting the tab key gives two spaces.
So far, so good.

However, when I copy to the drupal.bbeditSettings file to a directory
on a SMB share, then it doesn't get used by BBEdit. I've also tried
copying my entire test directory to an SMB share and the settings file
doesn't get used there as it does when it is on my local drive. Is
there a work around that would allow the settings file to work in a
directory on a mounted drive?

Other Issues encountered:
1. I noticed is that if the file doesn't have a trailing new-line then
the settings file won't be used.

2. If I open the View --> Text Display --> Show Fonts panel, the Tab
Width is still listed as 4.
When hit the tab key however, I get two spaces and the Tab Width
displayed in the Show Fonts panel switches to 2. This is a little
funny, but not a big deal as the tab width generally works.

3. The EntabWidth, DetabWidth, and TidySpacesPerTab don't seem to have
any effect, but I don't really need these settings anyway.

Thanks again for your assistance.

- Adam


On Nov 10, 10:37 am, Rich Siegel <sie...@barebones.com> wrote:
> On Wednesday, November 10, 2010, Adam Franco <adamfra...@gmail.com>

Rich Siegel

unread,
Nov 10, 2010, 12:16:23 PM11/10/10
to bbe...@googlegroups.com
On Wednesday, November 10, 2010, Adam Franco
<adamf...@gmail.com> wrote:

>However, when I copy to the drupal.bbeditSettings file to a directory
>on a SMB share, then it doesn't get used by BBEdit. I've also tried
>copying my entire test directory to an SMB share and the settings file
>doesn't get used there as it does when it is on my local drive.

Correct - this is done by default for performance reasons, but
you can enable it. Here's the excerpt from the 9.6 change notes:

When editing files that are on remote file servers (AFP, NFS,
SMB, etc), BBEdit will no longer look for directory-relative
tags files or settings files. This is a particular performance
win when the file is located on a volume mounted via MacFUSE/SSH
or similar, or if the file server is over a slow or high-latency
link.

To re-enable scanning for tags or settings files, use these
separately or together:

defaults write com.barebones.bbedit
Misc:DisableCtagsScanOnRemoteVolumes -bool NO

defaults write com.barebones.bbedit
Misc:DisableSettingsScanOnRemoteVolumes -bool NO

>3. The EntabWidth, DetabWidth, and TidySpacesPerTab don't seem to have
>any effect, but I don't really need these settings anyway.

Not all settings are loaded from directory-specific files.
Unfortunately there is no documentation of which ones are and
which ones aren't, so you'll need to try the ones you care about
-- but in general, settings which affect the display and editing
behaviors and are remembered with a document's state can be
changed with directory specific prefs, and most others cannot.

Adam Franco

unread,
Nov 10, 2010, 1:06:20 PM11/10/10
to BBEdit Talk
Thanks Rich, it is now working as I hoped. This is a fabulous feature!

Thanks again for you prompt help.

- Adam


On Nov 10, 12:16 pm, Rich Siegel <sie...@barebones.com> wrote:
> On Wednesday, November 10, 2010, Adam Franco
>

Adam Franco

unread,
Dec 4, 2014, 10:15:47 AM12/4/14
to bbe...@googlegroups.com
Unfortunately after upgrading BBEdit from 9.6.3 to 11.0.1 it seems that per-directory settings are now gone or broken. I've tried the commands to enable the feature as mentioned in the 10.1.1 release notes:
  • Scanning for .bbeditSettings files is now off by default, gated on an expert preference. The feature is deprecated, so don't get too attached to it because it's going to go away for good in a future version. Meanwhile, if you rely in it, please let us know how you use it, and you can turn it back on using an expert preference:

    defaults write com.barebones.bbedit EnableSettingsScan -bool YES

but this no longer seems to have an effect.

During years of using BBEdit 9.6 I've been relying on .bbeditSettings files like this to keep my white-space correct for each project:

[Editor]
AutoExpandTabs = 1
DefaultTabWidth = 2



If this feature is truly gone is there any other way to set the "Auto Expand Tabs" and "Tab Width" for a collection of files? I work on many open-source projects in the same language (PHP) and they all have different coding standards related to tabs versus spaces. This feature was a saving grace for not messing that up.

Best,
Adam

Rich Siegel

unread,
Dec 4, 2014, 11:18:14 AM12/4/14
to bbe...@googlegroups.com
On Thursday, December 4, 2014, Adam Franco
<adamf...@gmail.com> wrote:

>Unfortunately after upgrading BBEdit from 9.6.3 to 11.0.1 it
>seems that per-directory settings are now gone or broken.

They're still present, though the previous caveat about the
feature being deprecated still applies.

The preference key for enabling settings file discovery on
remote volumes has changed; it is now
"DisableSettingsScanOnRemoteVolumes", so try:

defaults write com.barebones.bbedit
DisableSettingsScanOnRemoteVolumes -bool NO

William Reveal

unread,
Dec 4, 2014, 12:31:22 PM12/4/14
to bbe...@googlegroups.com
I run into this issue as well, different projects requiring different settings. Gonna miss it when you completely get rid of it unless you allow for project level settings. Unfortunately for me, I have had to resort to another editor that works with the editorconfig.ini settings for one project http://editorconfig.org since a couple other developers are now using editorconfig and require all to use those settings. I don't care right now for most projects since I can still use my bbedit settings file as long as I remember to .gitignore it.

Adam Franco

unread,
Dec 4, 2014, 2:02:18 PM12/4/14
to bbe...@googlegroups.com
Thanks for your reply, Rich.

I've done the following on two separate macs with BBEdit 11.0.1 installed:

$ defaults write com.barebones.bbedit EnableSettingsScan -bool YES
$ defaults write com
.barebones.bbedit DisableSettingsScanOnRemoteVolumes -bool NO
$ defaults read com
.barebones.bbedit EnableSettingsScan
1
$ defaults read com
.barebones.bbedit DisableSettingsScanOnRemoteVolumes
0

I've also quit and reopened BBEdit and even restarted one of the machines, however BBEdit 11.0.1 doesn't seem to pick up any settings in my "Drupal.bbeditSettings" file either on the local disk or on a samba share. The settings in the file don't apply to existing files or new ones created via the command line with `touch test.php` (and hence wouldn't have existing per-file settings that might stick around).

Is there any way to debug the scan process to determine why previously working settings files aren't being found (or successfully loaded)?

As Bill notes, I'm going to really miss this feature unless there is a new way to achieve a similar result via project settings or some other collection mechanism (like http://editorconfig.org ).

Best,
Adam

Rich Siegel

unread,
Dec 4, 2014, 2:16:22 PM12/4/14
to bbe...@googlegroups.com
On Thursday, December 4, 2014, Adam Franco <adamf...@gmail.com> wrote:

> I've done the following on two separate macs with BBEdit 11.0.1 installed:

Please write to support.

Thanks,
Reply all
Reply to author
Forward
0 new messages