#GMSnip - Snippets on steroids

1 messages · Page 1 of 1 (latest)

maiden quarry
#

Stemming from a GMC forum topic (link here) I created this small, experimental utility in Python (converted to an executable) some months ago. It allows you to define unlimited snippets (by editing a JSON file and optionally a Python script for advanced use) that can be used in Gamemaker (or elsewhere) to insert arbitrary text. It supports:

  • Simple snippets - for example, type something like :hi and it gets replaced by Hello World!. These can be multiline, and are similar to Gamemaker's own snippets.
  • Snippets with parameters - for example, type something like :method and a form will pop up that asks you for a method name and a parameter name, then replaces it with my_function(my_param) for example. The parameters are configurable, the form gets automatically rendered.
  • Custom snippets - for example, type something like :calc, write an arbitrary calculation on the form, such as 1 + (3/5), then call a custom Python function that processes those parameters and returns a result string, then substitutes your input (in this case with 1.6).

Experimental but useful I think, let me know your thoughts, suggestions or bugs.


Current version: 0.21
Provided as-is. Use at your own risk.

Short demo video: https://www.youtube.com/watch?v=EsWTEzGSqOA
Page with documentation and download: https://manta-ray.itch.io/gmsnip

buoyant gorge
#

we definetely need plugins in IDE, good that they are coming

turbid junco
#

slightly relevant. but i do like the implementation, though would advise changing it to ::<thing> before it's triggered as i commonly type a one line struct with no space and will easily trigger this when i dont intend to.
https://help.gamemaker.io/hc/en-us/articles/360022531011-How-To-Create-a-Custom-Code-Snippets-File

#

love that it auto fills JSDocs though

maiden quarry
turbid junco
#

There is another third party tool which simplified the process above, believe it's just called GMSnippet? but yes, it does not have nearly the capabilities as you've shown in your project. Really like it. when it's an IDE plug in I'll be using this exclusively. Will save a ton of time creating jsDocs