Home > OS >  Is there a way to create a code snippet with an arbitrary prefix? (VScode)
Is there a way to create a code snippet with an arbitrary prefix? (VScode)

Time:06-30

I'm looking to create a VScode snippet that would execute on an arbitrary prefix. I'm not exactly sure if a snippet is the right term for it, but here's what I'm thinking:

myFunction();
// Autofill this block
call(myFunction);
//

myFunctionNamedBob();

// Autofill this block
call(myFunctionNamedBob);
//

Is it possible to insert call(anyFunction) any time I hit enter after anyFunction();?

Thanks in advance.

CodePudding user response:

the extension Snippet Generator does a good creating snippets, else you can create user snippets by :

  • clicking on cmd shift p
  • type snippets
  • select configure user snippets
  • new user snippets and there you go you can create it and it links to the snippet by file name more infos provided in vs code documentation: call function snippet


    You can get automatic triggering with the extension HyperSnips automatic insertion of a snippet

  • Related