0

Every time I create a new file in Vs Code an untitled file comes and I can't change the extension of the file unless I save the file. Is there a way to change the name and extension of the file without having trouble saving it first? I have seen someone rename the file and the extension without having to save the file. This is why I wanted to know how to do it.

3 Answers3

0

You can choose the file format prior to saving it enter image description here

here you can see it's plain text but you can change it (Python,JSON and more) Also refer to this Question regarding the naming

Tamir
  • 1,224
  • 1
  • 5
  • 18
0

yes we can, after creating new file in VS code. click on bottom right pain text and select language which you want without saving.

see the below image for more understand: enter image description here

Namrata Sanja
  • 216
  • 2
  • 1
0

Modify how ctrl+n works. Preferences: Open Keyboard Shortcuts (JSON)

  {
    "key": "ctrl+n",
    "command": "-workbench.action.files.newUntitledFile"
  },
  {
    "key": "ctrl+n",
    "command": "explorer.newFile"
  }

https://stackoverflow.com/a/39599731/9854149

weiya ou
  • 2,730
  • 1
  • 16
  • 24