Beginner programmer looking for dragonfly commands for Visual Studio code

83 views
Skip to first unread message

Alex Boche

unread,
Mar 1, 2019, 6:16:45 AM3/1/19
to Dragonfly Speech Recognition
180Does anyone have a good set of commands for Visual Studio code that I could use? I'm using caster and they don't have that many commands for VS code though they do have some (https://paste.gg/p/anonymous/c8a1376a1a4848228344c914396a38e6) – caster is more focused on other editors, but I think I'd like to stick with VS code for now if that seems reasonable to people. I am interested in any commands people have for VS code, but a couple specific things that come to mind are commands for integrating with git and commands for moving lines around e.g. take lines number blank through blank and move them to line blank. My background: I am just learning to program and to use dragonfly. Thank you very much.

Caspar

unread,
Mar 2, 2019, 1:25:02 AM3/2/19
to Dragonfly Speech Recognition
Vscode user here. Most of my vscode usage is covered by fairly standard cursor movement commands. Couple of examples:
  • fish N -> ctrl+left to move left N words
  • shift fish N -> ctrl+shift+left select previous N words
  • [shift] fame N -> move right N words or select N words right
  • scratch/kite N -> delete N words forwards/backwards (using selection like shift fish/fame, because some text inputs don't accept
  • left/right/dup/down <n> -> hit arrows keys in that direction n times ("dup" instead of "up" because dragon easily misrecognizes background noises as "up")
  • prend/prome and wag/crimp -> end/home and page down/up. I've set it up so that any straight keypress (like these) can be combined with shift or control too, so this is how I jump to end or start of a doc too.
  • shockoon/shockearly N -> insert N lines before/after
  • snipline N -> delete N lines. This was hard to do reliably across various editors and text fields (smart home, first/last lines, preserving indentation, etc) so here's the command I use for this: Key("home:2, s-end, s-right, del")
  • stoosh/snatch/spark -> copy/cut/paste
You get the idea - these are from a mix of the basic multiedit grammar, voicecode, caster, other peoples' configs and a lot of experimentation.

I do have a bunch of vscode specific commands, but they're much easier to set up - basically when I find something's missing, I look at the keyboard shortcuts and bind a key to a command. My grammar itself is private for privacy & convenience ATM, but I've dropped the relevant portion into https://gist.github.com/caspark/a1e40977fb906a373e6a4a04609e3c03 . Note that you can't slap these into a MappingRule straight up; the short version of it is that `vscode_repeatable_action_map` commands have an implicit ability to be repeated, while the other commands do not. In practice they follow a format like James described over at http://handsfreecoding.org/2015/04/25/designing-dragonfly-grammars/ , though I only fully understood that post once I took a lot of time to understand his current grammar ( https://github.com/wolfmanstout/dragonfly-commands/blob/master/_repeat.py ) and ported the key pieces over for my own use.

So, back on topic, the main thing that snippet is probably useful for is pointing you at useful extensions and ideas for vscode commands that might be worth setting up voice commands for.

Justin Hall

unread,
Mar 4, 2019, 7:32:25 AM3/4/19
to Dragonfly Speech Recognition
Hello Alex, I'm in a very similar position to you as I am also getting started on VS code. Maybe we can share notes as we go along?

You can email me directly if you want to make contact:
wave...@gmail.com

Justin

Justin Hall

unread,
Mar 4, 2019, 11:37:06 AM3/4/19
to Dragonfly Speech Recognition
Hi Caspar, I'm trying out the vscode.py file you referred to but I'm getting an error due to a missing module "languages". I tried to pip install "languages" but there is no such module and it's not clear which I need to import, do you know which it is?

Thank you

Alex Boche

unread,
Mar 4, 2019, 11:54:36 PM3/4/19
to Dragonfly Speech Recognition
Hi Justin, 229
I'm active on the Gitter chats for caster and dragonfly (also mathfly which is for voice math/latex). please get in touch there.  I'm called arkali thereI'm looking forward to trying out these VS code commands want to get a chance:

On Monday, March 4, 2019 at 4:32:25 AM UTC-8, Justin Hall wrote:
Hello Alex, I'm in a very similar position to you as I am also getting started on VS code. Maybe we can share notes as we go along?

You can email me directly if you want to make contact:

Caspar

unread,
Mar 5, 2019, 12:22:38 AM3/5/19
to Dragonfly Speech Recognition
Hey Justin, there's no mention of the word "languages" in my gist, so I'm afraid I can't really help you there (though to repeat what I said in my first message, I don't suggest trying to use it as-is, but rather as an inspiration for things worth binding to commands).

That error sounds like a generic Python error rather than a Dragonfly error, so chat or stackoverflow might be a better place to seek help than this list? In general, people in the Dragonfly Gitter are pretty helpful (you can sometimes catch me online there) in case it does happen to be a Dragonfly issue.

Ryan Richter

unread,
Mar 5, 2019, 1:43:54 PM3/5/19
to dragonf...@googlegroups.com
I am another Visual Studio code user. I also recommend looking up the extensive list of hotkeys and binding what is useful to you to a voice command. I have mostly just copied the multiedit.py example and replaced it with my own commands for each new rule I want to make, including my rule for Visual Studio code.

I wanted to add that for git usage, I make use of the integrated terminal (there is a hotkey to bring this terminal up) and then I have voice commands that run the commands for git that I need from that terminal.

I am on Windows, I use git-bash from the git-scm installation for Windows as my terminal in Visual Studio code. It may be possible to run the git commands from the default power shell terminal as well, I'm just more familiar with bash.

-Ryan

--
You received this message because you are subscribed to the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dragonflyspee...@googlegroups.com.
To post to this group, send email to dragonf...@googlegroups.com.
Visit this group at https://groups.google.com/group/dragonflyspeech.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/33ff8e75-ef30-4f51-bdc5-6c1f1bac1e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Caspar

unread,
Mar 5, 2019, 11:42:46 PM3/5/19
to Dragonfly Speech Recognition
Actually that reminds me - a hidden but nice feature of using VSCode is that it has a command "Terminal: Run Selected Text In Active Terminal", and if you bind that to a shortcut, you can trigger it via voice. And since most (all?) of the vscode "do X with selection" commands default to using the current line if there is no selection, you can use cursor movement commands to execute shell or other commands which you have in a currently open editor.

This is a neat trick because bash terminals typically have readline keybindings, so you'd need alt+f and alt+b to jump a word backwards or forwards normally, but in vscode's editor you can just your normal commands and treat your editor as terminal inputs. (eventually as you become more proficient in managing your voice coding config, it becomes worth setting up a separate grammar and context etc with terminal specific "move word left/right" commands, but the vscode terminal + run selected text workaround is great for people getting started.)

The other cool thing this opens up is that you can have an editor tab with a bunch of commonly used commands in it on each line, and easily duplicate or otherwise edit them, and then you can pretty straightforwardly execute them with a line jump command ("line 24 run this line"). It sort of ends up being like your shell history or readline's reverse-i-search except more accessible for users with input lag (IMO our biggest problem as voice coders). Probably there's room for hacking a tmux pane to always show the latest history in your shell so you can do something like this in a regular terminal, but I haven't gotten around to trying to script that yet :)

- Caspar

Ryan Richter

unread,
Mar 6, 2019, 11:24:48 AM3/6/19
to dragonf...@googlegroups.com
Thank you, this is a very nice tip!

Alex Boche

unread,
Mar 7, 2019, 10:58:41 PM3/7/19
to Dragonfly Speech Recognition
260There is a VS code plug-in called git lens. Would you recommend using that or activating git within the VS code terminal?


On Tuesday, March 5, 2019 at 10:43:54 AM UTC-8, Ryan Richter wrote:
I am another Visual Studio code user. I also recommend looking up the extensive list of hotkeys and binding what is useful to you to a voice command. I have mostly just copied the multiedit.py example and replaced it with my own commands for each new rule I want to make, including my rule for Visual Studio code.

I wanted to add that for git usage, I make use of the integrated terminal (there is a hotkey to bring this terminal up) and then I have voice commands that run the commands for git that I need from that terminal.

I am on Windows, I use git-bash from the git-scm installation for Windows as my terminal in Visual Studio code. It may be possible to run the git commands from the default power shell terminal as well, I'm just more familiar with bash.

-Ryan

On Mon, Mar 4, 2019 at 9:22 PM Caspar <caspar....@gmail.com261> wrote:
Hey Justin, there's no mention of the word "languages" in my gist, so I'm afraid I can't really help you there (though to repeat what I said in my first message, I don't suggest trying to use it as-is, but rather as an inspiration for things worth binding to commands).

That error sounds like a generic Python error rather than a Dragonfly error, so chat or stackoverflow might be a better place to seek help than this list? In general, people in the Dragonfly Gitter are pretty helpful (you can sometimes catch me online there) in case it does happen to be a Dragonfly issue.

On Monday, 4 March 2019 08:37:06 UTC-8, Justin Hall wrote:
Hi Caspar, I'm trying out the vscode.py file you referred to but I'm getting an error due to a missing module "languages". I tried to pip install "languages" but there is no such module and it's not clear which I need to import, do you know which it is?

Thank you

--
You received this message because you are subscribed to the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dragonflyspee...@googlegroups.com262.
To post to this group, send email to dragonf...@googlegroups.com263.
Visit this group at https://groups.google.com/group/dragonflyspeech264.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/33ff8e75-ef30-4f51-bdc5-6c1f1bac1e52%40googlegroups.com265.
For more options, visit https://groups.google.com/d/optout266.

Caspar

unread,
Mar 7, 2019, 11:40:55 PM3/7/19
to Dragonfly Speech Recognition
Git lens is a solid extension, but ultimately I would recommend every would-be-serious git user learn the git CLI once they've gotten past the initial hurdle of learning git. Tig is a nice terminal-based UI which works well with voice control (mostly driven by single character commands, which you could map to voice commands). Going the other direction is sourcetree, which a lot of people like and recommend, but I'm not a user so not sure how voice-friendly it is. Personally I have voice commands mapped to common terminal Git commands directly ( https://gist.github.com/caspark/8befa498978b1240a25382db20710735 ) and then it's easy enough to speak any necessary flags afterwards myself (I use `git add patch` a lot to stage hunks interactively for example).

- Caspar

Alex Boche

unread,
Mar 11, 2019, 5:53:53 AM3/11/19
to Dragonfly Speech Recognition
251 thanks for the suggestions! Looking forward to trying out some of the more sophisticated suggestions you made but so far I have gone through a list of hotkeys and made commands for them if anybody finds that useful here it is  https://gist.github.com/alexboche/44d8867433349d735d5d40c1b3deed9f

On Thursday, March 7, 2019 at 8:40:55 PM UTC-8, Caspar wrote:
Git lens is a solid extension, but ultimately I would recommend every would-be-serious git user learn the git CLI once they've gotten past the initial hurdle of learning git. Tig252 is a nice terminal-based UI which works well with voice control (mostly driven by single character commands, which you could map to voice commands). Going the other direction is sourcetree253, which a lot of people like and recommend, but I'm not a user so not sure how voice-friendly it is. Personally I have voice commands mapped to common terminal Git commands directly ( https://gist.github.com/caspark/8befa498978b1240a25382db20710735254 ) and then it's easy enough to speak any necessary flags afterwards myself (I use `git add patch` a lot to stage hunks interactively for example).

- Caspar

On Thursday, 7 March 2019 19:58:41 UTC-8, Alex Boche wrote:
260There is a VS code plug-in called git lens. Would you recommend using that or activating git within the VS code terminal?

On Tuesday, March 5, 2019 at 10:43:54 AM UTC-8, Ryan Richter wrote:
I am another Visual Studio code user. I also recommend looking up the extensive list of hotkeys and binding what is useful to you to a voice command. I have mostly just copied the multiedit.py example and replaced it with my own commands for each new rule I want to make, including my rule for Visual Studio code.

I wanted to add that for git usage, I make use of the integrated terminal (there is a hotkey to bring this terminal up) and then I have voice commands that run the commands for git that I need from that terminal.

I am on Windows, I use git-bash from the git-scm installation for Windows as my terminal in Visual Studio code. It may be possible to run the git commands from the default power shell terminal as well, I'm just more familiar with bash.

-Ryan

On Mon, Mar 4, 2019 at 9:22 PM Caspar <caspar....@gmail.com261255> wrote:
Hey Justin, there's no mention of the word "languages" in my gist, so I'm afraid I can't really help you there (though to repeat what I said in my first message, I don't suggest trying to use it as-is, but rather as an inspiration for things worth binding to commands).

That error sounds like a generic Python error rather than a Dragonfly error, so chat or stackoverflow might be a better place to seek help than this list? In general, people in the Dragonfly Gitter are pretty helpful (you can sometimes catch me online there) in case it does happen to be a Dragonfly issue.

On Monday, 4 March 2019 08:37:06 UTC-8, Justin Hall wrote:
Hi Caspar, I'm trying out the vscode.py file you referred to but I'm getting an error due to a missing module "languages". I tried to pip install "languages" but there is no such module and it's not clear which I need to import, do you know which it is?

Thank you

--
You received this message because you are subscribed to the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dragonflyspee...@googlegroups.com262256.
To post to this group, send email to dragonf...@googlegroups.com263257.
Visit this group at https://groups.google.com/group/dragonflyspeech264258.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/33ff8e75-ef30-4f51-bdc5-6c1f1bac1e52%40googlegroups.com265259.
For more options, visit https://groups.google.com/d/optout266260.

alexander15w

unread,
Mar 11, 2019, 7:15:17 PM3/11/19
to Dragonfly Speech Recognition
If you ever get deeply into this, one idea would be to write a visual code plug-in that lets you get the line number. Then you can do mod line number commands, which I have found to be very useful.  (Mark L. did some of these for Vocola and WinPad32, and I ended up writing a plug-in for sublime text that would do this).  For example you can say things like yank 22 through 45, and outward copy lines from 222-245 for example if your screen happens to be scrolled to have those in visible range. 

I looked at writing a plug-in for Visual Studio code but it's all based on node and JS, and it was more work than I was willing to invest at the time.

Another suggestion is to make use of the regex goto commands ie ctrl-P.  I have a number of equivalents in sublime text for which I can just say "goto myfile.py", and that will automatically ctrl-P + whatever dictation (or whatever specific list of files I have).  That makes navigation across files go very quickly by voice.

Alex Boche

unread,
Mar 11, 2019, 11:39:35 PM3/11/19
to Dragonfly Speech Recognition
328I will pay 150257 US dollars for anyone to write me such a plug-in as the one that Alexander is describing. Sounds like this will be mostly independent of whether using vocola or dragonfly or anything else, but to the extent that it is dependent on that I would like it to be written in dragonfly rather than vocola ideally, since you cannot change commands across 2 different command utilities. I don't totally understand Casper's suggestions but I would probably be willing to pay a bit for those 2 if somebody could implement them for me. If you're interested please email me akb...@gmail.com. Thanks


On Monday, March 11, 2019 at 4:15:17 PM UTC-7, alexander15w wrote:
If you ever get deeply into this, one idea would be to write a visual code plug-in that lets you get the line number. Then you can do mod line number commands, which I have found to be very useful.  (Mark L. did some of these for Vocola and WinPad32, and I ended up writing a plug-in for sublime text that would do this).  For example you can say things like yank 22 through 45, and outward copy lines from 222-245 for example if your screen happens to be scrolled to have those in visible range. 

I looked at writing a plug-in for Visual Studio code but it's all based on node and JS, and it was more work than I was willing to invest at the time.

Another suggestion is to make use of the regex goto commands ie ctrl-P.  I have a number of equivalents in sublime text for which I can just say "goto myfile.py", and that will automatically ctrl-P + whatever dictation (or whatever specific list of files I have).  That makes navigation across files go very quickly by voice.


On Friday, March 1, 2019 at 3:16:45 AM UTC-8, Alex Boche wrote:
180Does anyone have a good set of commands for Visual Studio code that I could use? I'm using caster and they don't have that many commands for VS code though they do have some (https://paste.gg/p/anonymous/c8a1376a1a4848228344c914396a38e6329) – caster is more focused on other editors, but I think I'd like to stick with VS code for now if that seems reasonable to people. I am interested in any commands people have for VS code, but a couple specific things that come to mind are commands for integrating with git and commands for moving lines around e.g. take lines number blank through blank and move them to line blank. My background: I am just learning to program and to use dragonfly. Thank you very much.

Alex Boche

unread,
Mar 11, 2019, 11:44:09 PM3/11/19
to Dragonfly Speech Recognition
That was 150 not 150,257

Anatole M

unread,
Mar 12, 2019, 12:12:44 PM3/12/19
to dragonf...@googlegroups.com
Just for future reference this is probably the place to start. Visible ranges looks like the first key piece of information



--
You received this message because you are subscribed to a topic in the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dragonflyspeech/F2fRAmd9C-8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dragonflyspee...@googlegroups.com.
To post to this group, send email to dragonf...@googlegroups.com.
Visit this group at https://groups.google.com/group/dragonflyspeech.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/d6fa4236-8988-4f21-b615-e9565c131539%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Boche

unread,
Mar 13, 2019, 7:23:43 AM3/13/19
to Dragonfly Speech Recognition
323
I think another thing that would be great to add would be an equivalent of Emacs is smart parens

On Tuesday, March 12, 2019 at 9:12:44 AM UTC-7, alexander15w wrote:
Just for future reference this is probably the place to start. Visible ranges looks like the first key piece of information

On Mon, Mar 11, 2019, 8:44 PM Alex Boche <akb...@gmail.com325> wrote:
That was 150 not 150,257

On Monday, March 11, 2019 at 8:39:35 PM UTC-7, Alex Boche wrote:
328I will pay 150257 US dollars for anyone to write me such a plug-in as the one that Alexander is describing. Sounds like this will be mostly independent of whether using vocola or dragonfly or anything else, but to the extent that it is dependent on that I would like it to be written in dragonfly rather than vocola ideally, since you cannot change commands across 2 different command utilities. I don't totally understand Casper's suggestions but I would probably be willing to pay a bit for those 2 if somebody could implement them for me. If you're interested please email me akb...@gmail.com326. Thanks


On Monday, March 11, 2019 at 4:15:17 PM UTC-7, alexander15w wrote:
If you ever get deeply into this, one idea would be to write a visual code plug-in that lets you get the line number. Then you can do mod line number commands, which I have found to be very useful.  (Mark L. did some of these for Vocola and WinPad32, and I ended up writing a plug-in for sublime text that would do this).  For example you can say things like yank 22 through 45, and outward copy lines from 222-245 for example if your screen happens to be scrolled to have those in visible range. 

I looked at writing a plug-in for Visual Studio code but it's all based on node and JS, and it was more work than I was willing to invest at the time.

Another suggestion is to make use of the regex goto commands ie ctrl-P.  I have a number of equivalents in sublime text for which I can just say "goto myfile.py", and that will automatically ctrl-P + whatever dictation (or whatever specific list of files I have).  That makes navigation across files go very quickly by voice.


On Friday, March 1, 2019 at 3:16:45 AM UTC-8, Alex Boche wrote:
180Does anyone have a good set of commands for Visual Studio code that I could use? I'm using caster and they don't have that many commands for VS code though they do have some (https://paste.gg/p/anonymous/c8a1376a1a4848228344c914396a38e6329327) – caster is more focused on other editors, but I think I'd like to stick with VS code for now if that seems reasonable to people. I am interested in any commands people have for VS code, but a couple specific things that come to mind are commands for integrating with git and commands for moving lines around e.g. take lines number blank through blank and move them to line blank. My background: I am just learning to program and to use dragonfly. Thank you very much.

--
You received this message because you are subscribed to a topic in the Google Groups "Dragonfly Speech Recognition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dragonflyspeech/F2fRAmd9C-8/unsubscribe328.
To unsubscribe from this group and all its topics, send an email to dragonflyspee...@googlegroups.com329.
To post to this group, send email to dragonf...@googlegroups.com330.
Visit this group at https://groups.google.com/group/dragonflyspeech331.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragonflyspeech/d6fa4236-8988-4f21-b615-e9565c131539%40googlegroups.com332.
For more options, visit https://groups.google.com/d/optout333.
Reply all
Reply to author
Forward
0 new messages