Tips and Tricks Note: Tips and Tricks has moved to the official Visual Studio Code documentation at. The content is now at. Pull requests and documentation issues are still greatly appreciated. Table of Contents. The key bindings below may or may not be accurate with the latest build. See for the latest keyboard shortcut reference. Basics Insider Version of VS Code The Visual Studio Code team uses the Insiders version to test the latest features and bug fixes of VS Code.
You can use this same version. For Early Adopters - Insiders has the most recent code changes and may lead to the occasional broken build. Frequent Builds - New builds everyday with the latest bug fixes and features.
Mar 22, 2017 - Visual Studio Code is a lightweight code editor from Microsoft. TypeScript and Node.js and is available for Windows, MacOS and Linux. After that you're able to start a new terminal window, change into your project. How to run Visual Studio Code from Terminal on Mac OSX Edit: You can just do this from Visual Studio Code now. Edit: Thanks for commenter on letting know that latest release of Code broke original post.
Side-by-side install - Insiders installs next to the Stable build allowing you to use either independently. Getting Started Open the Welcome page to get started with the basics of VS Code. Help Welcome.
Includes the Interactive Playground. Command Palette Access all available commands based on your current context. Mac: cmd+shift+p or f1 Windows / Linux: ctrl+shift+p or f1 Reference keybindings All of the commands are in the Command Palette with the associated key binding (if it exists).
If you forget what the key binding is use the Command Palette to help you out. Quick open Quickly open files. Mac: cmd+p Windows / Linux: ctrl+p Tip: Type '?' To view help suggestions. Navigate between recently opened files Repeat the Quick Open keyboard shortcut to cycle quickly between recently opened files. Open multiple files from Quick Open You can open multiple files from Quick Open by pressing the Right arrow key. This will open the currently selected file in the background and you can continue selecting files from Quick Open.
CLI tool Linux: Follow instructions. Windows: Follow instructions. Mac: see below. Open the Command Palette ( F1) and type 'shell command'. Hit enter to execute Shell Command: Install 'code' command in PATH. # open code with current directory code. # open the current directory in the most recently used code window code -r.
# create a new window code -n # change the language code -locale=es # open diff editor code -diff # see help options code -help # disable all extensions code -disable-extensions.vscode folder Workspace specific files are in.vscode. For example, tasks.json for the Task Runner and launch.json for the debugger. Status Bar decorations Errors and Warnings Mac: shift+cmd+m Windows / Linux: ctrl+shift+m Quickly jump to errors and warnings in the project. Cycle through errors with f8 or shift+f8 You can filter problems by type ('errors', 'warnings') or text matching. Change language mode Mac: cmd+k m Windows / Linux: ctrl+k m If you want to persist the new language mode for that file type, you can use the Configure File Association for. Command to associate the current file extension with an installed language. Customization There are many things you can do to customize VS Code.
Change your theme. Change your keyboard shortcuts. Tune your settings. Add JSON validation. Create snippets. Install extensions Check out the full.
Change your theme Open the Command Palette and type 'themes'. You can install more themes from the extension Marketplace. Additionally, you can install and change your File Icon themes. Change your keyboard shortcuts Keyboard Reference Sheets Download the keyboard shortcut reference sheet for your platform (, ).
Keymaps Are you used to keyboard shortcuts from another editor? You can install a Keymap extension that brings the keyboard shortcuts from your favorite editor to VS Code. Go to Preferences Keymap Extensions to see the current list on the. Some of the more popular ones:. Customize your keyboard shortcuts Open the Command Palette and type 'keyboard shortcuts.' You can now add your own keybindings in the file on the right.
Tune your settings Open settings.json Mac: cmd+, Windows / Linux: File Preferences Settings or ctrl+, Format on paste. 'files.autoSave ': 'afterDelay ' You can also toggle Auto Save from the top-level menu with the File Auto Save. Toggle Sidebar Mac: cmd+b Windows / Linux: ctrl+b Zen Mode Mac: cmd+k z Windows / Linux: ctrl+k z Enter distraction free Zen mode.
Side by side editing Mac: cmd+ or cmd then click a file from the File Explorer. Windows / Linux: ctrl+ Linux: ctrl+2 You can use drag and drop editors to create new editor groups and move editors between groups. Switch between editors Mac: cmd+1, cmd+2, cmd+3 Windows / Linux: ctrl+1, ctrl+2, ctrl+3 Move to Explorer window Mac: cmd+shift+e Windows / Linux: ctrl+shift+e Create and open a file Mac: cmd+click Windows / Linux: ctrl+click Close the currently opened folder Mac: cmd+w Windows / Linux: ctrl+k f History Navigate entire history with ctrl+tab Navigate back.
Mac: ctrl+- Windows / Linux: alt+left Navigate Forward. Mac: ctrl+shift+- Windows / Linux: alt+right Navigate to a file Mac: cmd+e or cmd+p Windows / Linux: ctrl+e or ctrl+p File associations Create language associations for files that aren't detected accurately (for example, many config files are JSON).
Git config -global merge.tool code Pull request extension Review pull requests inside vscode Debugging Configure debugger f1 and select Debug: Open launch.json, select the environment. This will generate a launch.json file.
Works out of the box as expected for Node.js and other environments. May need some additional configuration for other languages. See for more details. Breakpoints and stepping through Place breakpoints next to the line number. Navigate forward with the Debug widget. Data inspection Inspect variables in the Debug panels and in the console.
Inline values You can set 'debug.inlineValues': true to see variable values inline in the debugger. This feature is experimental and disabled by default. Task Runner Auto detect tasks Select Tasks from the top-level menu, run the command Configure Tasks., then select the type of task you'd like to run. This will generate a tasks.json file with content like the following. See the Tasks for more details.