VSCode — how to set working directory for debugging a Python program

@SpeedCoder5’s comment deserves to be an answer. In launch.json, specify a dynamic working directory (i.e. the directory where the currently-open Python file is located) using: “cwd”: “${fileDirname}” This takes advantage of the “variables reference” feature in VS Code, and the predefined variable fileDirname. If you’re using the Python: Current File (Integrated Terminal) option when you … Read more

Visual Studio Code – Convert spaces to tabs

There are 3 options in .vscode/settings.json: // The number of spaces a tab is equal to. “editor.tabSize”: 4, // Insert spaces when pressing Tab. “editor.insertSpaces”: true, // When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents. “editor.detectIndentation”: true editor.detectIndentation detects it from your file, you have to disable it. … Read more

How can I open Visual Studio Code’s ‘settings.json’ file?

To open the User settings: Open the command palette (either with F1 or Ctrl+Shift+P) Type “open settings” You are presented with two options, choose Open Settings (JSON) Which, depending on platform, is one of: Windows %APPDATA%\Code\User\settings.json macOS $HOME/Library/Application\ Support/Code/User/settings.json Linux $HOME/.config/Code/User/settings.json The Workspace settings will be in a {workspaceName}.code-workspace file where you saved it, and … Read more

Disable tooltip hint in Visual Studio Code

editor.hover.enabled: false in settings.json to Tooltip Click on Edit in settings.json There are two panes Default User Settings “editor.quickSuggestions”: { “other”: false, “comments”: false, “strings”: false } User Settings “editor.parameterHints.enabled”: false, “editor.suggest.snippetsPreventQuickSuggestions”: false, “html.suggest.html5”: false, “editor.snippetSuggestions”: “none”, This also can be done UI. Setting Snippet Suggestions : false Update August 2018 (version 1.27) Goto File=>Preference=>Settings … Read more

How to exclude file extensions and languages from “format on save” in VSCode?

You can use language specific settings to enable it for a specific language only, e.g. JavaScript: “[javascript]”: { “editor.formatOnSave”: true } To disable it for a specific language, you could switch the global default to true and combine it with a language-specific false: “editor.formatOnSave”: true “[javascript]”: { “editor.formatOnSave”: false } Note that language specific settings … Read more