vscode-markdown
vscode-markdown copied to clipboard
Add option to set the default language of a code block
Proposal
I am using this extension to write a lot of README
files with code blocks of commands that I need to run.
Consequently in 95% of the cases, the code blocks will have a bash formatting then:
``` bash
// command here
```.
It would be great if there was an option to specify the default formatting of code blocks so that I wouldn't have to type 'bash' each time I insert a code block.
Thanks for the feedback.
To me it is not a general use case for most users, so I'm going to leave this open and see what other people think.
You may try to define your own snippet https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets and assign a keybinding to it https://code.visualstudio.com/docs/editor/userdefinedsnippets#_assign-keybindings-to-snippets
Oh thanks, I didn't know about that yet! For my use case, I have now defined the following snippet:
"Code block": {
"prefix": ["cbb"],
"body": [
"``` bash",
"$1",
"```"
],
"description": "A code block with bash formatting"
}