INI files

From BBEditExtras
Jump to: navigation, search

BBEdit supports .ini-style preferences files, primarily for globally setting expert preferences without relying on defaults write; but they can also be used to determine preferences on a directory-specific basis. A good description of the INI file format can be found [on Wikipedia http://en.wikipedia.org/wiki/INI_file].

To use directory-specific settings, 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. So, given this arrangement of files:

   super.h
   folder/
       Foobar.bbeditSettings
       mumble.c
       misc/
           notes.txt
           scratch.h

Any settings specified in Foobar.bbeditSettings will apply to mumble.c, as well as all of the files in misc, but not to super.h.

If no directory-specific file exists, BBEdit will look for ~/.bbedit, and if it exists it will be examined for a matching preference key.

Note: Beginning with BBEdit 10.1.1, directory-specific settings files are enabled only if the EnableSettingsScan expert preference is turned on:

defaults write com.barebones.bbedit EnableSettingsScan -bool YES

Also, for performance reasons, directory-specific settings file discovery is disabled on remote file server volumes. You can re-enable it thus, if desired:

defaults write com.barebones.bbedit DisableSettingsScanOnRemoteVolumes -bool YES