I can access the (JSON) file by simply:
Open the command palette (either with F1 or Ctrl+Shift+P)
Type "open settings"
And then choose Open Settings (JSON)
The thing is that when i open those settings all the options presented are these:
"workbench.colorTheme": "Default Dark+",
"python.defaultInterpreterPath": "------------",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"workbench.editor.enablePreview": false,
Nothing more, I want to change my option through the (JSON) settings.
I even installed the VIM extension and I would love to be able to customize it in the (JSON) file.
Any suggestions?
settings.json is empty by default. It only contains settings that you've modified.
You can show the full list of JSON settings using Ctrl+Shift+P -> Preferences: Open Default Settings (JSON). Or just modify them from the GUI.
Does the json file not just override what is the default setting? so anything you put in there becomes the new default?
(Also, settings can be for a project workspace or global, so is that file in your project?)
When you want to make a different settings on a specific project, you will make .vscode/settings.json.
I know how to make .vscode/settings.json. If I make that directory and file and name as .vscode and settings.json then those files will be functioning as the setting of the project of the directory.
But I'm lazy to do those all acts. Is there some simpler ways to make the settings.json file on each project directory? Like by using a shortcut key we could make the file, or just by using a button from a extension.
---updated on Nov 1st, 2022---
I think,
Select File > Preferences > Settings (or press Ctrl+,)
and Select Workspace tab, and then changing any setting
is the fastest way to make the .vscode/settings.json now.
if you change any setting of there, immediately vscode will make the file. No other shortcut, but I think this is quite reasonable.
If you need to change some settings in vscode, vscode will make the .vscode/settings.json automatically.
go to settings GUI, Ctrl+,
select Workspace tab
click Open Settings (JSON) button in top right corner
Or
Execute command: Preferences: Open Settings (JSON)
Or any of the other open settings commands.
The launch.json file should be inside the .vscode folder, but it is not present there.
How can I get this file so that I can modify the configurations?
As described in the Launch Configurations section of the Visual Studio Code documentation:
VS Code keeps debugging configuration information in a launch.json
file located in a .vscode folder in your workspace (project root
folder) or in your user settings or workspace settings.
To create a launch.json file, click the create a launch.json file link
in the Run start view.
As of Visual Studio Code 1.56:
Once that's created, it should now be available under your workspace's .vscode folder.
Click on the debug side bar to open the debugging options. Then either the cog icon at the top, or the create a launch.json file link below the big blue button. If the launch.json file is present, it will open it otherwise it will generate one.
Warning: if you try to create an empty one (or one with an invalid content), trying to get to that file through the "Create a launch.json file" would not do anything.
See issue 133327.
That will be fixed with VSCode 1.61 (Sept. 2021): at least, that existing file will be opened when you click on "Create a launch.json file".
I did it many times, and each time I forgot where it was.
Menu File → Preferences → Settings.
I get this:
I want to open file settings.json (editable JSON file) instead. How can I do that?
To open the User settings:
Open the command palette (either with F1 or Ctrl+Shift+P)
Type "open settings"
You are presented with a few options¹, choose Open User Settings (JSON)
This image was taken in the VS Code online editor
Which, from the manual and 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 the Folder settings will be in a .vscode folder if and when it has been created.
Official page on User and Workspace Settings
As stated by sevencardz below, VS Code includes a button in the Settings UI gutter which can be used to switch between JSON and graphical view.
The workbench.settings.editor option selects which of the settings files is opened by default when not using the above method, such as with the shortcut ⌘+, or through the application menu.
Footnotes
The aforementioned settings, User and Workspace. Remote settings will appear when using WSL.
By a test this maps to %APPDATA%\Roaming\Code\User\settings.json, I am not sure by what logic.
On the settings UI page, there's a special button in the top right corner gutter that toggles between the settings.json file and the settings UI.
Bonus Answer:
Add "workbench.settings.editor": "json" to your settings.json file. This will make it so that menu File → Preferences → Settings or ⌘ + , opens your settings.json file by default. Optionally, add a comment at the top to remind yourself where the toggle button is.
// Click the Open Settings (UI) button in the top
// right corner gutter to toggle the settings UI
{
// Other settings in settings.json
// ...
"workbench.settings.editor": "json"
}
Follow these steps:
Shift + CMD + P
Type "settings"
Click on "Preferences: Open Settings (JSON)"
Visual Studio Code Tips and Tricks
If you want to edit local workspace/folder settings instead of global user settings, you can edit the file .vscode/settings.json (shortcut: Ctrl/Cmd + P and type "settings.json").
If that settings.json file or the folder .vscode do not exist, you can create them in the folder directory.
These settings will apply to the specific project.
These changes are global, so it will affect all of your projects.
You can change the settings.json file from user preferences.
Menu File → Preferences → Settings → Extensions → search for "Edit in settings.json"
Eventually edit these files directly:
Linux: $HOME/.config/Code/User/settings.json
macOS: $HOME/Library/Application Support/Code/User/settings.json
Windows: %APPDATA%\Code\User\settings.json
On Windows, the default keybind to open the settings UI within VSCode is Ctrl + ,. From there, there is a button at the top right to "Open Settings (JSON)":
That is one way to get to it. For convenience, I have bound Ctrl + Shift + , to opening the settings JSON. For reference, the setting ID for that is workbench.action.openSettingsJson.
Open VS Code.
Go to settings by clicking the keyboard shortcut ctrl + , or with GUI
File -> Preferences -> Settings
Refer this image
Click on the Open Settings (JSON) icon.
Refer to the image
Once you click on the icon it should open settings.json file
If still, that did not work.
Go to the search bar and type json:scheme
There click on Edit in settings.json. This should work.
But still, if it hit you in the head with a brick please let me know.
In Just 2 steps
1- Hit the shortcut Ctrl+Shift+P
(If you use a MAC it's ⌘+Shift+P):
2- Type in the search bar user settings json, and finally press Enter:
And you're done! Here you can change the general configs of VS Code in the settings.json.
However note that that there are also other types of settings.json which are relative to a project or a workspace for instance.
On a Mac the settings file is found at ~/Library/Application\ Support/Code/User/settings.json - it can be opened from the command line:
open -a 'visual studio code.app' ~/Library/Application\ Support/Code/User/settings.json
On Windows:
Click (Fn) + F1 (or Ctrl + P + >)
Type open settings json
Select Preferences: open settings (JSON)
For each project (with Git enabled), VSCode auto generate a project specific config file called .vscode.
How to disable this behavior?
Maybe some extention is doing it? It shouldn't create folder unless workspace settings were changed or created runner or tasks or debug.
Look what's inside that settings.json file.
Try to run vscode without extentions.
You can also exclude it from explorer:
setting.json (ctrl+,) >>
"files.exclude": {
"**/.vscode": true,
},