How can I do tag wrapping in Visual Studio Code?

Embedded Emmet could do the trick: Select text (optional) Open command palette (usually Ctrl+Shift+P) Execute Emmet: Wrap with Abbreviation Enter a tag div (or an abbreviation .wrapper>p) Hit Enter Command can be assigned to a keybinding. This thing even supports passing arguments: { “key”: “ctrl+shift+9”, “command”: “editor.emmet.action.wrapWithAbbreviation”, “when”: “editorHasSelection”, “args”: { “abbreviation”: “span”, }, }, …

Read more

How can I prevent VS Code from replacing a newly opened, unmodified (preview) tab with a subsequently opened one?

When you [single-]click a file in the left sidebar’s file browser or open it from the quick open menu (Ctrl–P, type the file name, Enter), Visual Studio Code opens it in what’s called “Preview Mode”, which allows you to quickly view files. Preview Mode tabs are not kept open. As soon as you go to …

Read more

How to turn off the prettier trailing comma in VS Code?

Since you are working on the Tour of Heroes project, it is maybe the .editorconfig file there that introduces conflicts with your VSCode Prettier settings. Try adding the following .prettierrc file at the root of your project : { “trailingComma”: “none” } The .prettierrc file has the highest priority over any setting, so it should …

Read more

VSCode: delete all comments in a file

Easy way: Open extensions (ctrl-shift-x) type in remove comments in the search box. Install the top pick and read instructions. Hard way: search replace(ctrl-h) toggle regex on (alt-r). Learn some regular expressions! https://docs.rs/regex/0.2.5/regex/#syntax A simple //.* will match all single line comments (and more ;D). #.* could be used to match python comments. And /\*[\s\S\n]*\*/ …

Read more