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

Rename File

NicholasAlt

|
3 installs
| (1) | Free
A VS Code extension for renaming the current file based on the word under the current cursor.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Rename File VS Code Extension

Easily rename the current file in VS Code, with smart suggestions based on the word under your cursor and language-aware casing.

Features

  • Rename File: Quickly rename the current file, pre-filling the input with the current file name (excluding the extension).
  • Rename File Smart: Suggests new file names based on the word under your cursor, offering camelCase, PascalCase, kebab-case, and snake_case variants. The default suggestion is language-aware and configurable.

Commands

  • Rename File (editor.renameFile):
    • Renames the current file, pre-filling the input with the current file name (excluding the extension).
    • No smart suggestions; just type the new name.
  • Rename File Smart (editor.renameFileSmart):
    • Suggests new file names based on the word under your cursor, with camelCase, PascalCase, kebab-case, and snake_case options.
    • The default suggestion is based on your language configuration.

Both commands are available in the Command Palette and can be assigned to keyboard shortcuts.

Configuration

You can configure language-specific default casing for smart suggestions:

{
  "renameFile.languageNamingStyles": {
    "*": "camelCase", // Default for all languages
    "csharp": "PascalCase", // C# files use PascalCase
    "xml": "PascalCase" // XML files use PascalCase
  }
}
  • Supported casing values: camelCase, PascalCase, kebab-case, snake_case
  • The * entry is the fallback for all languages not explicitly listed.

See Also

See the CHANGELOG.md for a summary of changes and release notes.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft