keypirinha-snippets icon indicating copy to clipboard operation
keypirinha-snippets copied to clipboard

Parameter support

Open at-ng opened this issue 2 years ago • 1 comments

I think it would be nice if parameters were supported for snippets. This would probably work similar to variables but the value is entered as an argument/parameter instead (unless it's possible to trigger an actual prompt asking for input). Then you could for example create a snippet like this:

repeast5=${par:1} ${par:1} ${par:1} ${par:1} ${par:1}

You would call is with "repeat5 hello" and get the string "hello hello hello hello hello" back. This specific example is not super useful (a repeat command would be more useful if there is scripting to enable "repeat hello 5"). However parameter support in itself can be a time saver, for example if you have a long SQL query as a snippet but you need to add a search key in the middle of the query (possibly in multiple places).

at-ng avatar Nov 18 '21 12:11 at-ng