How to prevent Visual Studio Code from always reopening the previous files or folders?

You can also go into your settings and use the following: “window.reopenFolders”: “none” which will not reopen the folders you were working on when you closed the editor. The other options are one (the default) and all. Edit 2017-11-09: The option is now changed in latest versions. “window.restoreWindows”: “none” See Mathieu DOMER’s answer. Edit 2018-09-12: … Read more

How can I remove duplicate lines in Visual Studio Code?

If the order of lines is not important Sort lines alphabetically, if they aren’t already, and perform these steps: (based on this related question: How do I find and remove duplicate lines from a file using Regular Expressions?) Control+F Toggle “Replace mode” Toggle “Use Regular Expression” (the icon with the .* symbol) In the search … Read more

How do I format all files in a Visual Studio Code project?

Use the extension called ”Format Files”. Here are the steps: Download the extension called ”Format Files” on VSCode. Select and open the folder with files to format on VSCode. Press Ctrl+Shift+P to open command palette. Enter “Start Format Files: Workspace” and select this option. Source: https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files

VSCode single to double quote automatic replace

I dont have prettier extension installed, but after reading the possible duplicate answer I’ve added from scratch in my User Setting (UserSetting.json, Ctrl+, shortcut): “prettier.singleQuote”: true A part a green warning (Unknown configuration setting) the single quotes are no more replaced. I suspect that the prettier extension is not visible but is embedded inside the … Read more

How to set per-filetype tab size?

VS Code configures language specific settings in settings.json Shortcut is: Command Palette (⇧⌘P) then: Preferences: Configure Language Specific Settings Example of setting.json changing tabsize { “[sass]”: { “editor.tabSize”: 2 }, “[html]”: { “editor.tabSize”: 4 }, “[javascript]”: { “editor.tabSize”: 2 } } These are not nested inside any other object, they are defined at the root.

Visual Studio Code cannot detect installed git

Now you can configure Visual Studio Code (version 0.10.2, check for older versions) to use existing git installation. Just add the path to the git executable in your Visual Studio Code settings (File -> Preferences -> Settings) like this: { // Is git enabled “git.enabled”: true, // Path to the git executable “git.path”: “C:\\path\\to\\git.exe” // … Read more

Visual studio code – keyboard shortcuts – expand/collapse all

Here it is. Ctrl+Shift+[ Fold (collapse) region editor.fold Ctrl+Shift+] Unfold (uncollapse) region editor.unfold Ctrl+K Ctrl+[ Fold (collapse) all subregions editor.foldRecursively Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.unfoldRecursively Ctrl+K Ctrl+0 Fold (collapse) all regions editor.foldAll Ctrl+K Ctrl+J Unfold (uncollapse) all regions Take Look at Visual studio Code Keybindings section at this link. Also Platform specific Key … Read more