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.

0

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

thank you so much for the help... it was bugging me for few days after I updated it.
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

Comments

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.