Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Quick New FileNew to Visual Studio Code? Get it now.
Quick New File

Quick New File

Aviv

|
149 installs
| (0) | Free
Create a new file that's similar to this file: same package and language.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Quick New File: A VSCode Extension

Quicker way to create a new file (that looks like the current one).

Features

Hit ctrl+shift+N to create a new file that has the same context as the current one:

  • Same extension and directory
  • Same package declaration (where applicable)
  • Same imports
  • Same hashbang (#!) string (also, chmod +x)
  • Boilerplate code (where applicable)

Supported Languages

  • Go (Package, imports and build constraints)
  • Java (Package, imports and class boilerplate)
  • PHP (<?php)
  • Python (Imports)
  • Shellscript (set and source statement)

⚡NEW⚡ Extensions

Other extensions can now provide their own "New File" template/generator - useful for project-specific conventions.

To extend, add something like this to your extension:

export async function register(context: vscode.ExtensionContext) {
    const ext = vscode.extensions.getExtension('avive.quick-new-file');
    if (!ext) {
        return;
    }
    let api = await ext.activate();

    maker1 = {
        createNewContent(runner) {
            return "new body goes here";
        }
    }

    provider = {
        maker(reference: vscode.TextDocument) {
            return maker1;
        }

        order() { return 666; }
    }

    api.registerFileMakerProvider(provider);
}

The src/definitions/quick-new-file.d.ts file has more precise definitions.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft