1

I had Ctrl+N Ctrl+P bound to the command Python:createNewFile but it stopped working after a recent VSCode update (I believe, not sure if it was something else).

Does anyone know the VSCode key binding command to create a new Python file?

Ctrl+N gets me a new text file and I have to select the language or save it with .py for it to be a python file, which is cumbersome since I mostly use VSCode only for python.

Abhi O.
  • 141
  • 1
  • 8
  • Does adding `"files.defaultLanguage": "python"` to the `settings.json` file give you the expected behavior? – mahieyin-rahmun Aug 19 '22 at 17:36
  • which extension implements `Python:createNewFile` – rioV8 Aug 19 '22 at 17:58
  • The default extension - there are still a lot of `python.` commands available - just not that one. – Abhi O. Aug 25 '22 at 11:13
  • @mahieyin-rahmun Thank you and yes it works but that just forces every new file to a python file, even when I use the File menu and select new text file. Is there a way to tie this to a specific key binding? – Abhi O. Aug 25 '22 at 11:27
  • I'm in the same situation, after the update, VSCode shows that command 'python.createNewFile' not found, so I think it was replaced or deleted... – Fernando Gallego Fernández Sep 10 '22 at 11:50

0 Answers0