Skip to content
Ben Meyer edited this page Aug 18, 2015 · 36 revisions

Overview

Many VoiceCode commands operate differently based on configurable settings, also many commands operate based on predefined 'lists' or 'options'. These types of settings and options are defined in the following file:

~/voicecode/commando/config/default/settings.coffee

I recommend reading through this file so you know what is in it.

To add or override settings, do so in the following file:

~/voicecode/commando/config/user_settings.coffee

How to work with lists of options

Many VoiceCode commands use a predefined list of options to make decisions. For example, using the webs command to open a website from your predefined websites list.

These lists are defined as a simple mapping (JavaScript Object) where the spoken form is represented as the 'key' or left-hand side, and the represented value is the 'value' or right-hand side.

Fuzzy Match

Additionally, commands that choose an item out of a list based on your spoken arguments use a fuzzy matching algorithm so that even if your command is recognized slightly wrong, it will usually still trigger the correct action. For example when using a command to open a website in your predefined website list, if you said "webs mail", and there was no entry for "mail", but there was an entry for "gmail" it would deduce that you meant "webs gmail" because it is the closest match in the list.

Websites

A list of your commonly used websites

Used in:

  • webs [website] (opens a website in your default browser)
  • Alfred Workflow: vw

Customizing:

Settings.extend "websites",
  example: "http://example.com"
  "another example": "https://www.anotherexample.com"

Default Browser

Commands that open websites directly will use your system default browser. For other commands a default needs to be set as follows. For example, the "webseek" command switches to your browser and opens a new tab. It will fall back to Safari if no preference is set.

Settings.defaultBrowser = "Google Chrome"

Applications

A list of your commonly used applications

Used in:

  • fox [application_name] (opens an application)
  • Alfred Workflow: va

Customizing:

Settings.extend "applications",
  find: "Finder"
  chrome: "Google Chrome"
  tunes: "iTunes"
  logic: "Logic Pro X"

Abbreviations

A list of your commonly used word abbreviations

Used in:

  • frank [abbreviation_name] (inserts a shorthand abbreviation)
  • Alfred Workflow: va

Customizing:

Settings.extend "abbreviations",
  library: "lib"
 "my signature": "Cheers,\nBen"
  example: "ex."

Code Snippets

A list of your commonly used code-snippet auto-completions

Used in:

  • quinn [snippet_trigger] (inserts a code snippet)
  • Alfred Workflow: vs

Customizing:

Settings.extend "codeSnippets",
 "try catch": "try"
 "if else": "ife"

Code Snippet Completion Key

The to trigger the insertion of a code snippet in your IDE

Used in:

  • quinn [snippet_trigger] (inserts a code snippet)

Customizing:

Settings.extend codeSnippetCompletions,
  "Xcode": "Return"
  "Sublime Text": "Tab"

Directories

A list of your commonly used directories

Used in:

  • direct [directory_name] (opens a directory in the terminal)
  • dears [directory_name] (opens a directory in the Finder)
  • Alfred Workflow: vd

Customizing:

Settings.extend "directories",
  "projects": "~/projects"
  "code": "~/code"
  "voicecode videos": "~/projects/voicecode/videos"

Passwords

A list of your commonly used passwords

Used in:

  • trassword [password_name] (types in a password)
  • Alfred Workflow: vp

Customizing:

Settings.extend "passwords",
  "something": "lkjf987dflkjsdflkjsdflkjf"
  "something else": "lkjdf987dfuiy"

Security Notice

Currently, these passwords are just stored in plain text, so do not use them for passwords that need to be ultra-secure. Use a password manager for that. A secure solution is under development.

Emails

A list of your commonly used email addresses

Used in:

  • treemail [email_identifier] (types in an email address)
  • Alfred Workflow: ve

Customizing:

Settings.extend "emails",
  "me": "[email protected]"
  "you": "[email protected]"
  "my gmail": "[email protected]"
  "john gmail": "[email protected]"

Usernames

A list of your commonly used usernames

Used in:

  • trusername [username_identifier] (types in a username)
  • Alfred Workflow: vu

Customizing:

Settings.extend "usernames",
  "me": "myusername"
  "you": "yourusername"
  "project staging": "mystagingusername"
  "project production": "myproductionusername"

Translations

Translations globally map input phrases to a predefined output phrase.

Used in:

  • ALL text commands
  • Alfred Workflow: vt

Customizing:

Settings.extend "translations",
  "settimeout": "setTimeout" 
  "scrollview": "scrollView" 
  "userid": "userId"
  "user id": "userId"
  "mc view control": "MCViewCtrl"

Modes

A list of your commonly used modes (modes can be used inside a command to make decisions on which actions to perform)

Used in:

  • set mode [desired_mode] (sets the current mode explicitly)

Customizing:

Settings.extend "modes",
  vim: "vim"
  them: "vim" # 'vim' is a hard word to recognize, it is often mistaken for 'them'
  emacs: "emacs"
  "markdown": "markdown"

Workflows

A list of your commonly used workflows

Used in:

  • flak [workflow_name] (runs a predefined workflow)

Customizing:

Settings.extend "workflows",
  "big find this": "stoosh shofffomp spark shock"
  "set up my workspace": "fox chrome fox sublime fox safari fox term chommnerb trace talky trace gibby talky trace gibby talky trace shell-direct voicecode chommtwo shell-direct voicecode chommthree shell-direct voicecode chommone shell start voicecode"

Dragon Contexts

A list of the applications you want to have specific commands for

Used in:

  • Any application-specific command
  • Note: this one takes an array as an argument, rather than an object

Customizing:

Settings.extend "dragonContexts", [
  "Sublime Text"
  "Google Chrome"
]

Shell Commands

A list of your commonly used shell-commands

Used in:

  • shell [command_name] (types a shell command) (works in any application)

Customizing:

Settings.extend "shellCommands",
  permissions: "chmod "
  access: "chmod "
  chat: "cat "
  copy: "cp "
  move: "mv "
  remove: "rm "
  "remove directory": "rmdir "

Window Positions

A list of your commonly used window positions

Used in:

  • windy [window_position] (moves the active window to a certain position)

Customizing:

# units <= 1 are proportions
# units > 1 are absolute
Settings.extend "windowPositions",
  ipad:
    x: "auto" # center
    y: "auto" # center
    width: 1024
    height: 768
  iphone:
    x: 50
    y: 160
    width: 320
    height: 568
  "bottom third":
    x: 0
    y: 2 / 3
    width: 1
    height: 1 / 3

Menu Item Aliases

When using commands for opening drop-down menus, these aliases map to the full name of the menu. It is useful if the menu item has a long name such as "bookmarks". It is also useful, for names that are hard for Dragon to distinguish such as "view" - in this case it is used for correcting common recognition mistakes.

Used in:

  • swash [menu_item] (opens a drop-down menu item)

Customizing:

Settings.extend "menuItemAliases",
  books: "Bookmarks"
  viewer: "View"
  review: "View"
  few: "View"

Key Delay Settings

It's possible to change the speed at which keystrokes and keypresses happen using the following settings:

Customizing:

Settings.characterDelay = 4 # delay between pressing modifier keys before and after other keys
Settings.keyDelay = 8 # delay between keys like RightArrow, Return, Delete, etc.
Settings.modifierKeyDelay = 2 # delay between characters when typing a strin

Clone this wiki locally