Syncing BBEdit with Dropbox
BBEdit is anything but a “bare bones” text editor. The first version of BBEdit was created in 1991 as a “proof of concept” to replace the TextEdit control used in Mac OS at the time, which could not read files larger than 32K.
Since then numerous features and plugins have been added to BBEdit including native support for a wide variety of programming languages, powerful multi-file text searching with strong support for Perl-compatible regular expressions, WebKit enabled HTML preview, and FTP/SFTP tools that integrate with code management systems. BBEdit has one of the most extensive list of preferences out of any application I have ever used, and its Open Scripting Architecture can be accessed using a variety of scripting languages including AppleScript. Unfortunately a lot of BBEdit’s features utilize unique templates, stationary, scripts, and clippings that get saved locally to your computer’s Home Library folder. Wouldn’t it be great if these essential BBEdit assets and the state of open BBEdit documents could live in the cloud and be synchronized to all of your computer’s using Dropbox?
Application Support Folder
BBEdit’s Application Support Folder contains various sub folders, each of which holds a specific type of support item. Its standard contents include:
The Attachment Scripts folder contains AppleScripts which are run at specific points: when BBEdit starts, quits or is put to sleep, and when documents are open, saved, and closed.
The Auto-Save Recovery folder contains information which BBEdit can use to recover the contents of unsaved documents after a crash, or to restore them after use of the “Sleep BBEdit” command.
The Clippings folder contains clipping items. These items are text files which appear in the Clippings menu and palette.
The Completion Data folder contains tags files which can provide additional text completions for editing documents in the corresponding languages.
The HTML Templates folder contains HTML template files which are used by the New HTML Document command.
The Language Modules folder allows you to add syntax coloring and function navigation support for additional languages by installing language modules.
The Menu Scripts contains AppleScripts that are attached to BBEdit menu items.
This Scratchpad file contains the data for BBEdit’s Scratchpad.
You can place both AppleScripts and Automator workflows in the Scripts folder and use BBEdit’s Scripts menu to run them.
The Shutdown Items in this folder are opened when you quit BBEdit. Usually, this function will be used to run scripts of some sort. This folder does not exist by default.
When launched, BBEdit will open any items it finds in the Startup Items folder including scripts, assets, and application aliases. This folder does not exist by default.
The Stationery folder contains stationery files for use with BBEdit’s New with Stationery command, and the Stationery List palette.
The Text Factories folder contains text factory files, which you can access via the Apply Text Factory command, the Text Factories menu, or the Text Factories palette.
The Unix Support folder contains the Unix Scripts and Unix Filters folders, which are used to build the Shebang (#!) menu and the floating Unix Scripts and Unix Filters palettes.
To synchronize all of BBEdit’s assets between multiple computers it is best to move this folder to a location in your Dropbox and create a symbolic link back to its original location.
- I start by quitting BBEdit and creating a new pseudo Library folder in my Dropbox to hold Application Support files I wish to transfer from my Home Library.
- Inside my new Dropbox Library I create a new Application Support folder.
- I then copy my existing BBEdit Application Support directory from
~/Library/Application Support/BBEditto~/Dropbox/Library/Application Support/BBEdit. - Creating a symbolic link between my new Dropbox enabled BBEdit Application Support folder and its original location ensures that changes I make to my BBEdit Assets gets synced to the cloud.
ln -s~/Dropbox/Library/Application\ Support/BBEdit ~/Library/Application\ Support/BBEdit` - By repeating step 4 of this process for all of my Dropbox enabled Macs I can share the same BBEdit assets between all of my computers.
Preference File
All of BBEdit’s basic preference settings are stored in the file ~/Library/Preferences/com.barebones.bbedit.plist, which is created and maintained using standard OS services. At this time I do not synchronize this file with Dropbox because I prefer to have a slightly different set of preferences on the two different machines I work on. You might find this to be the case if you have a laptop and a desktop and prefer a different default font size on each.
Preferences Folder
BBEdit is different from many other Mac OS X applications because it stores a ancillary set of preferences and settings in ~/Library/Preferences/com.barebones.BBEdit.PreferenceData/. Its standard contents include:
BBEdit stores state information for individual documents in the Document State.plist.
BBEdit stores all user-defined file filter patterns in the File Filters.filefilters.
BBEdit stores user-defined FTP and SFTP bookmarks in the FTP Bookmarks.xml.
BBEdit stores user-defined search patterns in the Grep Patterns.xml.
BBEdit stores all user-defined search sources in the Saved Sources.xml.
The process of synchronizing this set of preferences is similar to the process of synchronizing BBEdit’s Application Support folder except maintaining a stable sync is more tricky because the contents of these folders often change dynamically. If a synchronization of BBEdit’s preference folder is performed it is absolutely vital that BBEdit is slept of shutdown on one computer, and all changes are synchronized through Dropbox before opening BBEdit on another computer.
- I start by quitting BBEdit and creating a new pseudo Library folder (if one does not already exist) in my Dropbox to hold preference files I wish to transfer from my Home Library.
- Inside my new Dropbox Library I create a new Preferences folder.
- I then copy my existing BBEdit Preferences directory from
~/Library/Preferences/com.barebones.bbedit.PreferenceDatato~/Dropbox/Library/Preferences/com.barebones.bbedit.PreferenceData. - Creating a symbolic link between my new Dropbox enabled BBEdit Preferences folder and its original location ensures that the changes I make to those preferences, including the state of open documents and windows gets synced to the cloud.
ln -s~/Dropbox/Library/Preferences/ com.barebones.bbedit.PreferenceData ~/Library/Preferences/com.barebones.bbedit.PreferenceData` - By repeating step 4 of this process for all of my Dropbox enabled Macs I can share the same BBEdit preferences between all of my computers.
Syncing both BBEdit’s Application Support folder and Preferences folder isn’t required for increased productivity, but by moving both folders to Dropbox the same set of assets and document states can be preserved among multiple computers.
Update
BBEdit 10 now supports Dropbox syncing without the creation of a symbolic link. If you use Dropbox, you may relocate your BBEdit application support and preference data folders to your active Dropbox folder, and BBEdit will use their contents from that location rather than the default locations within ~/Library/. In this way, you can easily share supporting files among multiple BBEdit installations.
In order to do this:
- Quit BBEdit if it is running.
- Move your BBEdit application support folder
~/Library/Application Support/ BBEdit/into a folder named “Application Support” within your Dropbox folder, so its final location is~/Dropbox/Application Support/BBEdit/. (Since Dropbox does not create an ‚“Application Support” folder by default, you may need to do so.) - Locate your BBEdit preference data folder either
~/Library/BBEdit/or~/Library/ Preferences/com.barebones.bbedit.PreferenceData/ - Rename your BBEdit preference data folder from ‚“BBEdit” or “com.barebones.bbedit.PreferenceData” to “PreferenceData”.
- Move the renamed preference data folder into
~/Dropbox/Application Support/BBEdit/.
Interested in trying Dropbox for yourself Use this link to get signed up and enjoy the dream of being in sync across all of your computers.