New File with Language ModeSummaryThis extension adds two types of commands to open a new file with a specified language mode.
The motivation for the first is that if you are working in a project, you might know that you need a new file of the same type but you don't know what to name it yet. Don't waste time coming up with a name just so you can save it and set the language mode and don't waste time manually setting the language mode. Simply assign a keyboard shortcut and start coding. The second command type is to help people that find themselves frequently opening markdown files to take throwaway notes in, or frequently opening typescript/powershell/python files to prototype scripts in, and want a quick way to get a scratchpad open in the language of their choice with the language features active. Inspiration:A stackoverflow user asked if it was possible to create a .HTML file when opening a new file in this question. As far as I know there is not a built in way, but the How to Use:The extension exposes a command called The extension also creates commands for each language that can be bound to keybindings. I've shown two examples below: keybindings.json:
To find the language id, click on the language id in the lower right corner of the VS Code window OR open the command palette, type "Change Languae Mode", and press enter. This will bring up a list of the known languages. The value in parenthesis is the language id. You should also be able to see a list of the available commands at the bottom of the keybindings editor. See MoreThis is a part of the my API Playground repository. Each subdirectory is a self-contained extension that demonstrates a particular API, repros a bug, answers a stackoverflow question, etc. Apis Used:
Release Notes1.1.0
1.0.0
0.0.1Initial release with simple command for opening new file of a configured type. |