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 do I duplicate a line or selection within Visual Studio Code?

The commands your are looking for are editor.action.copyLinesDownAction and editor.action.copyLinesUpAction. You can see the associated keybindings by picking: File > Preferences > Keyboard Shortcuts Windows: Shift+Alt+Down and Shift+Alt+Up Mac: Shift+Option+Down and Shift+OptionUp Linux: Ctrl+Shift+Alt+Down and Ctrl+Shift+Alt+Up (Might need to use numpad Down and Up for Linux) Furthermore, commands editor.action.moveLinesUpAction and editor.action.moveLinesDownAction are the ones to … Read more

How to run a command in Visual Studio Code with launch.json

You can define a task in your tasks.json file and specify that as the preLaunchTask in your launch.json and the task will be executed before debugging begins. Example: In tasks.json: For version 0.1.0: { “version”: “0.1.0”, “tasks”: [{ “taskName”: “echotest”, “command”: “echo”, // Could be any other shell command “args”: [“test”], “isShellCommand”: true }] } … Read more

How can I globally set the PATH environment variable in VS Code?

If you only need the $PATH to be set in the integrated terminal, you can use VS Code’s terminal.integrated.env.<platform> variable (added in version 1.15). Press Cmd+Shift+P (or Ctrl+Shift+P) and search for “Preferences: Open Settings (JSON)”. Then add the following entry to the settings file: “terminal.integrated.env.osx”: { “PATH”: “…:/usr/bin:/bin:…” } (Replace .osx with .linux or .windows … Read more

What project files does Visual Studio Code create via its Java extensions?

Simplified the Language Support for Java™ by Red Hat is the headless Eclipse Java IDE integrated into Visual Studio Code via the Language Server Protocol (LSP). See the self-description of the extension: Provides Java™ language support via Eclipse JDT Language Server, which utilizes Eclipse JDT, M2Eclipse and Buildship. Except for .vscode/, the mentioned files are … Read more

Make comments of VSCode start at column position 0

Here is a later and better way to do it: https://stackoverflow.com/a/72311327/836330 It is a little tricky, but test this out. You need a macro extension like multi-command. In your keybindings.json: { // disable ctrl+/ for js/php files only “key”: “ctrl+/”, “command”: “-editor.action.commentLine”, “when”: “editorTextFocus && !editorReadonly && resourceExtname =~ /\\.(js$|php)/” }, { // call the … Read more

How can I view original javscript library source code in VS Code and not the typescript version?

If your tsconfig.json has “allowJs”: true and “maxNodeModuleJsDepth” set to a sufficiently large number, and you uninstall the type declarations, then clicking “Go to definition” will take you to TypeScript’s best guess of the definition in the JavaScript, which may be no good for JavaScript code that was never designed to be statically analyzable (e.g., … Read more