0

I am searching for a way to create a certain file in a certain directory in my vscode project.
Preferred with a VScode command.
For example: A pre-configured default directory that automatically insert the created files with one command.

I found this previous post: VS Code - Add a new file under the selected working directory
But it does not address to create a file in a specific directory.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Ewro
  • 447
  • 4
  • 13
  • @user This command is related to the referred SO post. It creates a new file in the select working directory. – Ewro May 15 '23 at 20:15

1 Answers1

0

with the extension File Templates you can create an empty template with a given file path.

Create a template with the given content:

##@@## ~w/src/mylib/${input:File name:}

With Ctrl+N you can select the template, enter the filename and the file will be created.

You have to create a separate template for each type of file extension.

Or you can create a template named: placed-file-mylib.txt

And as filename type: mylib.cpp

The file created is: mylib.cpp.txt

In the explorer edit the file name: Ctrl+0 F2

rioV8
  • 24,506
  • 3
  • 32
  • 49