Русский | English
Visual Studio Code extension that allows you to quickly create or open temporary files. Forget manually creating files for notes, code snippets, or temporary data!
- Command:
Quick Temp File: Create or Open File... - What it does: Opens a dialog to create or select a file.
Demonstration:
- Command:
Quick Temp File: Create Instant File - What it does: Instantly creates and opens a new temporary file with a unique random name (UUID) and the default extension.
quickTempFile.cleanupStrategy: Defines when temporary files should be automatically deleted."never"(Default): Never delete files."onEditorClose": Delete a file as soon as its editor tab is closed."onWindowClose": Delete all files created during the session when the VS Code window is closed.
quickTempFile.defaultPath: The default directory for creating temporary files. (Default: system's temporary directory).quickTempFile.defaultExtension: The default file extension. (Default:.txt).
The extension exposes a internal command for programmatic use in other extensions, tasks.json, or advanced keybindings.json setups.
- Command ID:
quickTempFile.api.create - Arguments:
(args: object)
The args object can contain the following fields:
| Field | Type | Default | Description |
|---|---|---|---|
noDialog |
boolean |
false |
If true, the file is created immediately without a dialog. |
filename |
string |
undefined |
A specific name for the new file. Implies noDialog: true. |
content |
string |
undefined |
Initial content for the new file. |
directory |
string | null |
undefined |
Overrides the default directory. null uses the system temp folder. |
extension |
string |
undefined |
Overrides the default file extension. |
quiet |
boolean |
false |
If true, suppresses all non-error success notifications (e.g., 'File created'). |
contentFromClipboard |
boolean |
false |
If true, the file content will be read from the system clipboard. Overrides content. |
Create a file with content via keybindings.json:
{
"key": "ctrl+alt+s",
"command": "quickTempFile.api.create",
"args": {
"filename": "my-snippet.js",
"content": "console.log('My Snippet');"
}
}A completely silent API call from another extension (TypeScript):
// Create a file instantly, with no dialogs and no success popups.
// Errors will still be shown.
await vscode.commands.executeCommand('quickTempFile.api.create', {
noDialog: true,
quiet: true,
content: 'This was created silently.'
});