Daily Archives

One Article

Visual Studio Tips

Example settings.json for VS Code

Posted by matteskolin on

Microsoft Documentation on VS Code Settings Here

I thought It would be fun to share my settings.json file. The number of available settings in VS Code is truly staggering. In the documentation above, the default settings example is near three thousand lines long!

On Windows, the settings file is located here:
%APPDATA%\Code\User\settings.json

And on my machine specifically,
C:\Users\matte\AppData\Roaming\Code\User\settings.json

I also save this in my Microsoft OneDrive as a backup and a way for me to quickly setup on new machines.

These settings control many aspects of the IDE as well as extensions.

Below is the settings.json file that I use with comments.

{
    //extension[background] - disables background image
    "background.enabled": false,

    //shows tool bar on left side of screen with buttons for Tests, Solution Explorer, Extensions, Debug, etc.
    "workbench.activityBar.visible": true,

    //default zoom
    "window.zoomLevel": 1.5,

    //very important if you are a vim user. Taking back control of specific control keys as vim takes over many of them
    "vim.handleKeys":{
      "<C-k>":false,
      "<C-a>":false,
      "<C-t>":false,
      "<C-f>":false,
      "<C-c>":false,
      "<C-v>":false,
      "<C-x>":false,
      "<C-y>":false,
      "<C-h>":false,
      "<C-d>":false,
      "<C-b>":false
    },

    //my favorite key binding in vim - this will allow you to type "jk" to exist insert mode, instead of awkwardly reaching for escape key
    "vim.insertModeKeyBindings": [
    {
      "before": ["j", "k"],
      "after": ["<Esc>"]
    }
  ],
  "mssql.connections": [
    {
      "server": "DESKTOP-3CUUUOC",
      "database": "",
      "authenticationType": "Integrated",
      "profileName": "LOCAL_INSTANCE",
      "password": ""
    }
  ],

  //nice setting to hide the wierd code map that is often useless and hard to read
  "editor.minimap.enabled": false,

  "editor.showFoldingControls": "mouseover",
  "editor.folding": true,
  "editor.foldingStrategy": "auto",

  //unbelievable helpful fix for moving mouse through folds
  "vim.foldfix":true, 

  //hide preview
  "workbench.editor.enablePreview": false,
  "[csharp]": {
    "editor.defaultFormatter": "ms-dotnettools.csharp"
  },
  "vssolution.xmlClosingTagSpace": false
}