ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Voice​Code

by VoiceCode ALL

Sublime Text plugin that lets VoiceCode remote-control the editor

Details

Installs

  • Total 463
  • Win 249
  • Mac 151
  • Linux 63
Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

VoiceCode / Sublime Text (2|3) Integration Package

This is a Sublime Text plugin that lets VoiceCode control Sublime Text

This integration is needed because many VoiceCode voice commands are more sophisticated than simply pressing keys or clicking the mouse. For example, a command that selects the next curly brace, or a command that extends the current selection(s) forward until the next comma, etc.

Setup

First make sure the commandline utility for Sublime Text is installed and working https://www.sublimetext.com/docs/3/osx_command_line.html

Adding your own commands

If you want to add new commands that are not already included in this package, just add something similar to the following in a user extension file for Sublime Text.

import sublime, sublime_plugin

class SelectPreviousWordCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        pos = self.view.sel()[0].begin()
        all_previous = [r for r in self.view.find_all('\w+') if r.begin() < pos]
        if all_previous:
            region = all_previous[-1]  # return nearest
            if region:
                self.view.sel().clear()
                self.view.sel().add(region)

Then, in your VoiceCode user commands, you can call this Sublime Text command as follows:

@sublime().do('select_previous_word')

or if you need to pass options/arguments to a Sublime command, add them as the second parameter like:

@sublime().do('some_command', {foo: "bar", baz: 3.2})

Triggering existing Sublime Text commands

Sublime has a lot of builtin commands. To trigger them from VoiceCode simply do something like:

@sublime().do('goto_line', {line: 10})

Checkout this page for more info about Sublime commands.