Core Concepts
/

Settings

There is a global variable `Settings` under which all settings are contained. They are typically organized by package name, although there are a few root-level settings. Each package can define settings, and you can edit the settings of any package.

We have included a shorthand notation to do a "deep merge", merging new values (and nested values) with the existing values using the following syntax:

```

Settings.somePackage = { ... }

``

Editing settings

You can edit any package's settings from your own `settings.coffee` file or from any other user-code (`.coffee` or `.js`) file:

unboundmusic/4f752cf8c0ead9bffee654d3784e226e

If you want to delete a certain setting

```

delete Settings.somePackage.someSetting

``

Tip

If a package name has a space or dash in its name it needs to be accessed using bracket-notation instead of dot-notation, since javascript variable names can only contain alphanumeric characters and underscores:

```

Settings['some package with a space']

``

Using existing settings

If you need to access a setting in order for your code to make a decision, you can directly access any setting from any package using `Settings.packageName.settingName` such as:

unboundmusic/c53c1eae3d093bf641f0ccfbc9edbbd0

Inspecting existing settings

If you want to poke around with your live instance of VoiceCode, and all its runtime settings:

  • start up the VoiceCode CLI
  • type `Settings.somePackage`
  • hit `return ⏎` and you will see the current values for that package's settings
  • If you want to drill down to a specific setting, type `Settings.somePackage.someSetting`
  • If you want to see the entire Settings object, just type `Settings`

Settings examples:

The main `~/voicecode/settings.coffee` is where most basic settings should be placed:

unboundmusic/fc1594baaaf61ae0a4ec67dcb80de3ec

VoiceCode lets you create any directory structure you want for your settings and commands. We recommend creating a directory at `~/voicecode/settings` under which you could put all your different settings files.

For any specific package settings that might have a long list of options (i.e. websites, abbreviations, etc.) we recommend creating a file just for that package. This is so that your main settings file does not get really long and unwieldy, and makes it easier to find the file/setting you are looking for. You can use JavaScript or CoffeeScript, here's some examples:

Augment the vocabulary using various strategies
unboundmusic/6a819e45b734cd03ef6702f5de321460
Add some more websites to launch by name
unboundmusic/0cc1e488082da0ea5822d2d50b0b9893
Add some shortcuts and text snippets to insert by name
unboundmusic/f830dab5464524113762c6d1dc723c4c
Add some more applications, and some single word app shortcuts
unboundmusic/a1a923966ae0f28649c9f880f810051c
Add some more directories
unboundmusic/77e409648110f7f631efa0ac6347c14a
Add some more shell commands
unboundmusic/c376b970653a43ace339a09a0457e8b3
Boost recognition of certain words by creating a dragon command, but still process the word as plain dictation on VoiceCode side
unboundmusic/3244c9c5582e9b77c239204dd9bdf9d1
Add some editor code snippet completions
unboundmusic/e7302dc0acc321717945881834654f3d