Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Autohotkey hotstring in visual studio code?

I can use it in other applications such as notepad, but it just won't work with vs code.It seems that there is a bug or did I do any thing wrong? For example

::td::TODO

and every time I will get a different result:

AHK BUG

How to fix this?

like image 613
Steven Zhang Avatar asked Dec 29 '25 19:12

Steven Zhang


2 Answers

It is a bug from an extension Markdown All in One It is fine when I disabled it.

like image 119
Steven Zhang Avatar answered Jan 01 '26 11:01

Steven Zhang


Autohotkey workaround:

::td::{Sleep 100}TODO

Increase the 100ms as the hotstring (to delete) becomes larger. On my machine I could expand hotstrings with length 25 in 250ms. Your mileage may vary.

Relevant Github Issue

I replaced my hotstrings en masse with the following regex:

Search: ::[a-z0-9_-]+::(?!\{)
Replace: $0{Sleep 250}


In the Github issue Mehul has another workaround:

:SE, K1:td::TODO

This does not require a variable amount of ms as it will always work regardless of hotstring length but it took so long to print the replacement text I found it unworkable.

like image 20
Laoujin Avatar answered Jan 01 '26 13:01

Laoujin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!