How do you format code on save in VS Code
As of September 2016 (VSCode 1.6), this is now officially supported. Add the following to your settings.json file: “editor.formatOnSave”: true
As of September 2016 (VSCode 1.6), this is now officially supported. Add the following to your settings.json file: “editor.formatOnSave”: true
Go to File > Preference > Settings and choose: Workbench › Tree: Indent Controls tree indentation in pixels. or (in your settings.json enter this directly) “workbench.tree.indent”: 10 and choose a high enough number for you. Also see my answer at Visual Studio code sidebar Vertical guideline (customize sidebar) where with v1.36 you can add colorized … Read more
For Windows – Open your Default Browser – Tested on VS Code v 1.1.0 Answer to both opening a specific file (name is hard-coded) OR opening ANY other file. Steps: Use ctrl + shift + p (or F1) to open the Command Palette. Type in Tasks: Configure Task or on older versions Configure Task Runner. … Read more
With the current version of Visual Studio Code as of this writing (1.22.1), you can find your settings in ~/.config/Code/User on Linux (in my case, an, Ubuntu derivative) %APPDATA%\Code\User (C:\Users\username\AppData\Roaming\Code\User) on Windows ~/Library/Application Support/Code/User/ on Mac OS X (thank you, Christophe De Troyer) The files are settings.json and keybindings.json. Simply copy them to the target … Read more
.gitignore only ignores files that are not part of the repository yet. If you already git added some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm –cached on them.
Given a regular expression of (foobar) you can reference the first group using $1 and so on if you have more groups in the replace input field.
Ctrl + Shift + N will open a new window, while Ctrl+K then releases the keys, and pressing O would open the current tab in a new window. You can then use menu File → Open Folder to have two instances of Visual Studio Code with different folders in each window. ⌘ + Shift + … Read more
Currently it is not possible to change the font family or size outside the editor. You can however zoom the entire user interface in and out from the View menu. Update for our VS Code 1.0 release: A newly introduced setting window.zoomLevel allows to persist the zoom level for good! It can have both negative … Read more
Use files.exclude: Go to File -> Preferences -> Settings (or on Mac Code -> Preferences -> Settings) Pick the workspace settings tab Add this code to the settings.json file displayed on the right side: // Place your settings in this file to overwrite default and user settings. { “settings”: { “files.exclude”: { “**/.git”: true, // … Read more
Yes, there is the workbench.action.gotoSymbol command. On Windows and Linux it’s set to CTRL+Shift+O by default. If this command isn’t available for the file types you are working with then you should take a look at the VSCode extensions. Not all languages support this feature.