DocumentationInstallationCopy ODCompletionDictionary.pbplugin to
~/Library/Application Support/Apple/Developer Tools/Plug-ins/
and restart Xcode. After successful installation Completion Dictionary logs its version number to the Console whenever the plugin gets loaded into Xcode. Upgrading from previous versionsCompletion Dictionary 4.0 stores its configuration data in a new location. You therefore have to move and rename an existing configuration file from ~/Library/KeyBindings/CompletionKeyBinding.dict to ~/Library/ Further, the completion method selector has changed from completeUsingDictionary: to completionDictionaryExpandMacro:, so you have to update your key bindings as described in the following section. Customizing the completion shortcutBy default the Edit > Completion Dictionary > Expand Macro command can be invoked with Control-Escape. You may customize this shortcut in Xcode's Key Bindings preferences. Unfortunately, Xcode doesn't let you bind the Escape key (without any modifiers) to a menu command, which would be a very convenient shortcut though. However, it is possible to establish this binding by editing the appropriate key binding file manually. When using the default Key Binding SetIf you haven't yet created a custom "Key Binding Set" in Xcode's Key Bindings preferences, you can establish the key binding in
~/Library/KeyBindings/PBKeyBinding.dict
This file must contain at least the following lines:
{
"\U001B" = "completionDictionaryExpandMacro:"; } When using a custom Key Binding SetIf you are using a custom key binding set, Xcode ignores the settings in PBKeyBinding.dict. Therefore you must edit your custom key bindings file instead, which can be found at
~/Library/Application Support/Xcode/Key Bindings/*.pbxkeys
Open this file in Property List Editor, select Edit > Show Strings as Unicode and add a key binding to the "text" dictionary where the key is \U001B and the selector is completionDictionaryExpandMacro:.
Note: If you are upgrading from a previous version of Completion Dictionary you have to update your existing Completion Dictionary key binding and change the selector from completeUsingDictionary: to completionDictionaryExpandMacro: either in PBKeyBinding.dict or in your custom *.pbxkeys file.
ConfigurationChoose Edit > Completion Dictionary > Edit Macros or type Command-Option-comma to open the macro editor. You will see a set of pre-installed example macros, ready to be used immediately. You can add your own macros by entering several abbreviation-macro pairs, e.g:
PlaceholdersA macro may contain one or more placeholders for variable names, arguments and other program-specific information. A placeholder is delimited by <# and #> and can be inserted conveniently by choosing an item from the "Insert Placeholder" pull down menu.
Restoring the default configurationCompletion Dictionary includes a comprehensive set of default macros, illustrating lots of the plugin's capabilities. They provide a good starting point for your own macro definitions. If you wish to restore the default configuration at a later point, you just have to remove (or rename) your custom configuration file at
~/Library/Application Support/Completion Dictionary/Configuration.plist
and restart Xcode. The default configuration includes macros for C, Objective-C and HTML. Here are just a few noteworthy macros:
UsageOnce you've configured the dictionary you can use it as follows: Type the abbreviation and press the completion shortcut (Control-Escape by default). If the abbreviation is found in the dictionary, the corresponding macro is inserted, otherwise Xcode's built-in code completion is invoked. If the completion doesn't deliver the desired results, you can undo this operation with Command-Z. If the macro contains any placeholder the first placeholder will be selected, so you can replace it with your own code right away. If there's more than one placeholder you can cycle through the placeholders by either choosing Edit > Select Next Placeholder or typing If the macro contains any query placeholder, a panel will appear, allowing you to fill out the requested fields. Note that you can navigate through the fields using the up/down arrow keys. Once you've completed your input you can confirm with Return or dismiss this panel by pressing Escape. | Completion Dictionary![]() System Requirements
Completion Dictionary is likely to work with Xcode 1.5 / Mac OS X 10.3 as well, but this hasn't been explicitly tested. |