VSCode Snippets

Propose new features and changes
GinoMan2440
Posts: 1
Joined: 07 Sep 2022, 20:51
Contact:

VSCode Snippets

07 Sep 2022, 20:56

It would be cool if there was a hotstring-like syntax that does what VSCode does with Snippets

For those unfamiliar, you can create snippets that allow you to type in a codeword and hit tab which then expands a snippet with "tab-stops" where you can enter values into the template. You can also control the defaults, allow for a choice menu of optional values (when the value has to be one of a set of values), and even when you type a value in one place, it replicates that value elsewhere.

It would be cool if AutoHotKey allowed you to create snippets like this to use anywhere so it's not just in VSCode.

You can read more about it here: https://code.visualstudio.com/docs/editor/userdefinedsnippets
neogna2
Posts: 600
Joined: 15 Sep 2016, 15:44

Re: VSCode Snippets

08 Sep 2022, 05:56

GinoMan2440 wrote:
07 Sep 2022, 20:56
It would be cool if AutoHotKey allowed you to create snippets like this to use anywhere so it's not just in VSCode.
Nice idea but seems impossible. Because universal snippets with interactivity (tabbing between placeholders in the multiline text, dropdowns/suggestions for text at each placeholder) requires getting caret position and text changes from any active app and input field. But there's no universal method to get that in Microsoft Word, Google Docs, Notepad++, LibreOffice and countless other apps.

One doable alternative is hotkeys or hotstrings that trigger a popup GUI that show an interactive snippet and, once interacted with, sends/pastes the snippet to the previously active window's caret position. See Lintalist (made in AutoHotkey).

Another possibility is snippet functionality for only Scintilla controls, which are used by a number of editors and other text tools. Would be very nice to have! As a separate library though, not built into AutoHotkey.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 27 guests