cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.13k stars 78 forks source link

[Help] Getting Mathfly in VSCode Working #2349

Open davidleejy opened 3 months ago

davidleejy commented 3 months ago

Hi,

I happened to come across a fascinating YouTube video that demonstrates how LaTeX math can be typed in VSCode with the help of MathFly and Talon (https://www.youtube.com/watch?v=v0j2_W97_s0) and went ahead to try setting up MathFly + Cursorless. My hope is that such a setup would help speed up my efforts to digitize my math material and also do math directly in a commo typesetting framework.

Thus far, I've managed to get cursorless working in VSCode; I know this because I can see Talon hats above characters in text files opened in VSCode.

Next, I tried to install mathfly (https://github.com/mrob95/mathfly-talon) by cloning the entire repository into ~/.talon/users/mathfly-talon. However, unfortunately, I don't seem to be able to use mathfly commands in VSCode, which led me to seeking help here.

Is there something extra I need to do in Cursorless to enable mathfly commands in VSCode?

Do I need to modify the context set in mathfly scripts so that mathfly commands are considered by Talon and Cursorless when I issue voice commands in VSCode?

How can a user check what scripts are active in Talon/Cursorless?

Thank you for reading. πŸ˜„

pokey commented 3 months ago

Glad you liked the video! πŸ™ŒπŸ˜Š

Did you follow all the steps in the cursorless installation instructions? Do cursorless commands work? Eg "take air"

davidleejy commented 3 months ago

Thanks @pokey for sharing that video and for writing in to have a look at my situation πŸ˜ƒ .

Did you follow all the steps in the cursorless installation instructions? Do cursorless commands work? Eg "take air"

Yes, I followed the installation steps, and can perform cursorless commands like "take air". I am also able to see Talon hats above characters in the editor.

pokey commented 3 months ago

Ok. Which mathfly command did you try, and what happens when you try it? And does anything appear in your talon log?

davidleejy commented 3 months ago

Saying "greek alpha" in command mode, Talon doesn't catch it – the subtitles (that I've enabled) show text other than "greek alpha".

Saying "greek alpha" in dictation mode, Talon catches it fine and prints the string "greek alpha" in the .tex file in VSCode.

Saying "begin equation" in command mode, akin to the saying "greek alpha" in command mode, Talon doesn't catch it – the subtitles show text other than "begin equation".

I'm not sure if I have to say a certain phrase to enable "mathfly mode", if there's such a thing?

pokey commented 3 months ago

You need to use my fork of mathfly in order for it to work with Cursorless; looks like your link above is the mainline mathfly. Btw worth asking on the #maths channel in the Talon slack workspace to see if anyone has improved on my fork; it was very much just a proof of concept

davidleejy commented 3 months ago

I have replaced the mainline mathfly with your fork of mathfly. After I say "wake up", and Talon wakes up and is in command mode, what should I say next to test if the mathfly scripts are working? At the moment, it doesn't seem to be working :( I have restarted Talon and VSCode.

pokey commented 3 months ago

"greek alpha" should work if you're in a .tex file in VSCode

pokey commented 3 months ago

and really any of the commands from my video should work I think

davidleejy commented 3 months ago

Yep, I am in a .tex file, but none of the latex commands work. Saying "document class article", "greek alpha", "begin equation" while Talon is in command mode causes Talon to interpret these as if I were saying other things (I am able to see Talon printing its interpretation on-screen as subtitles).

By any chance do I need to install any other VSCode extensions? Like any LaTeX related extensions?

pokey commented 3 months ago

Huh strange. Might be easiest to drop into one of our Discord meet-ups (link; calendar (times in UTC))

davidleejy commented 3 months ago

Hi @maxbruening, couldn't help but notice that your fork of mathfly has been under active development recently, and was wondering if it would be all right to bounce off an issue I'm facing in getting @pokey 's mathfly to work.

I have:

and am able to use Cursorless in VSCode, and successfully compile .tex files into pdf files through VSCode. I am on Mac OS Sonoma & VSCode version 1.89.1.

It would appear that every mathfly-related component is working as expected except for mathfly's script.

If you happen to recall whether additional steps were needed to get mathfly to work, or modifications to the mathfly scripts (e.g., modified the script's "active context" setting), please feel free to let me know.

Thanks for reading, and hope you have a pleasant day. πŸ˜„

pokey commented 3 months ago

I would definitely recommend dropping into one of our Cursorless meet-ups to debug. It's a bit hard to for us to figure out what's going on without a screenshare

davidleejy commented 3 months ago

I would definitely recommend dropping into one of our Cursorless meet-ups to debug. It's a bit hard to for us to figure out what's going on without a screenshare

Would be happy to consider virtually meeting some of the people who have worked on or contributed cursorless, and maybe chat with some cursorless users. Is the cursorless meet-up schedule available somewhere online? I did a cursory google search for cursorless meet ups to no avail.

pokey commented 3 months ago

https://github.com/cursorless-dev/cursorless/issues/2349#issuecomment-2123079598

maxbruening commented 3 months ago

Agree with pokey that dropping in on the cursorless meetups makes most sense. Generally, the talon slack channel can also be super helpful. But if pokey is telling you he is willing to help in person, I would take him up on the offer, it will be hard to find more competent help ;)

davidleejy commented 3 months ago

Thanks @pokey and @maxbruening, will look into joining a cursorless meetup as soon as possible πŸ˜„. Any days (Tues/ Thurs/Sun) that might possibly be more conducive for troubleshooting with newcomers? Cheers, and have a great week ahead.

pokey commented 3 months ago

Thanks @pokey and @maxbruening, will look into joining a cursorless meetup as soon as possible πŸ˜„. Any days (Tues/ Thurs/Sun) that might possibly be more conducive for troubleshooting with newcomers? Cheers, and have a great week ahead.

Nope they're all great times for troubleshooting with newcomersβ€”that's what they're for 😊