QA Graphic

BBEdit Completion Data

A tool to easily add custom language autocorrect for coding

In BBEdit, there's a little known feature called "Completion Data." This allows developers to put in common language-specific auto-complete text, which makes writing similar code so much easier.

Basically it makes it quicker to type in common function, class or variable names.

Completion Datab
Completion Data Folder location inside of BBEdit. Also an example of Completion Data in action.

How it Works

There is a folder in BBEdit called "Completion Data" that contains text files of common text used in your code. These are organized by folders by language types. So you would only see the relevant auto-complete suggestion for the language that your currently coding.

If you never used "Completion Data" chances are this folder is empty. The collection is using the standard ctags format.

Bare Bones makes it easy to create the ctags collection, you simply use the BBEdit command-line tool.

Creating your Completion Data Collection

Here's the simple steps to create your own Completion Data collection. This example will build on JavaScript:

In Terminal, Change Directory to where you have a lot of JavaScript Files.

Run the following command:

bbedit --maketag

In your directory you'll see a new file called tags, this is the output of the above command. Go ahead and check it out in BBEdit.

Make a new folder in ~/Library/Application Support/BBEdit/Completion Data/ and call it JavaScript and move the tag file to that directory. (or just type this piece of code)

mkdir ~/Library/Application Support/BBEdit/Completion Data/JavaScript
mv tags ~/Library/Application Support/BBEdit/Completion Data/JavaScript

Now when you type something in a JavaScript file, you'll get some autocomplete suggestions based on previous code that you used.

Some Notes

You can have multiple tag files under each language, for example tags1, tags2 etc...

The language folder names have to match what you see in the bottom of the edit, such as HTML, Ruby, Markdown etc...

The "fastest" way to access the "Completion Data" folder is to use the BBEdit Menu BBEdit -> Folders -> Completion Data.

Code autocomplete is a similar concept to spelling autocomplete, basically saving typing a few characters.

"Completion Data" isn't something that your always going to do. Basically useful to have setup up every once in a while.

 

About

Welcome to the BBEdit Blog, the official source of insights, tips, tricks, and inspiration for all users of BBEdit, the powerful text and code editor from Bare Bones Software. Whether you're a seasoned developer, a budding coder, or someone who just loves the precision of text editing, this blog is crafted for you.

Interested in getting BBEdit? Get it from Bare Bones' Website.

Schedule

TuesdayQA
WednesdayAffinity
ThursdayBBEdit
FridayMacintosh
SaturdayInternet Tools
SundayOpen Topic
MondayMedia Monday