{ datagubbe }

datagubbe.se » sane visual studio code

Sane Visual Studio Code

At work, I use Visual Studio Code. It does some things great, such as locating files, navigating projects, and integrating with source control. It also has a fast "find in files" function.

It also has a lot of distracting features turned on by default, which makes the editor look more or less like a Christmas tree with blinking colors, little icons showing up out of nowhere and a bazillion different pop-up tooltips that, if given free reign, will soon cover all of the actual code being edited.

It also likes to tell me how I should format my text. It loves adding brackets, indentation, HTML tags and other formatting where I least expect and want it.

Concentration and attention are key in my work as a developer, and visual fluff that clutters my peripheral vision - or, indeed, pops up smack in the center off it - distracts and frustrates me when all I want to do is type what I'm thinking.

Fortunately, (almost) all of this can be turned off. Below is an annotated copy of my settings.json file, detailing what I've disabled and how to disable it.

    // Put the sidebar on the right like any sane person
    "workbench.sideBar.location": "right",

    "editor.renderIndentGuides": false,

    // The minimap is the scaled-down "screenshot" of the code
    // that's used instead of a scrollbar by default.
    "editor.minimap.enabled": false,

    "editor.dragAndDrop": false,

    // Never auto-close brackets for me.
    "editor.autoClosingBrackets": "never",

    // Never auto-close quotes for me.
    "editor.autoClosingQuotes": "never",

    // Never surround selections when typing quotes, brackets etc.
    "editor.autoSurround": "never",

    "window.openFilesInNewWindow": true,
    "window.zoomLevel": 0,

    // Disable validation of code in the editor.
    // This removes, among other things, the jagged red lines underneath
    // 'erroneous' code.
    "javascript.validate.enable": false,
    "typescript.validate.enable": false,

    // Never use "preview" editors, just open a real, new tab.
    "workbench.editor.enablePreview": false,

    // Trimming white space is a good thing.
    "files.trimTrailingWhitespace": true,

    // Don't highlight occurences. Note: This isn't the same as selection
    // highlighting. "Occurences" highlights identical occurences of whatever
    // the cursor is currently positioned at, regardless of whether it's
    // selected or not.
    "editor.occurrencesHighlight": false,

    // Don't recommend editor extensions.
    "extensions.ignoreRecommendations": true,

    // Don't highlight changed lines - ESPECIALLY not with
    // fancy colors in the editor gutter.
    "scm.diffDecorations": "none",

    // Disable "assists" suggestions lightbulb.
    "editor.lightbulb.enabled": false,

    // Parameter hints open a giant pop-up, so we disable it.
    "editor.parameterHints.enabled": false,
    "editor.parameterHints": false,

    // No chinese water torture, please.
    "editor.cursorBlinking": "solid",

    // Block cursor is best cursor.
    "editor.cursorStyle": "block",

    // Quick suggestions, auto complete, whatever it's
    // called it has got to go because it pops up ALL. THE. TIME.
    // Just let me type!
    "editor.quickSuggestions": {
        "other": false,
        "comments": false,
        "strings": false

    // Ah yes, more popups. Snippets will make it "quicker"
    // to write E.G. for loops, as if that's a main concern.
    "editor.snippetSuggestions": "none",

    // Enable scroll bars in both directions.
    "editor.scrollbar.vertical": "visible",
    "editor.scrollbar.horizontal": "visible",

    // Make the scroll bars actually thick enough to
    // be useful.
    "editor.scrollbar.verticalScrollbarSize": 15,
    "editor.scrollbar.horizontalScrollbarSize": 15,

    // Don't show suggestions on 'trigger' characters
    "editor.suggestOnTriggerCharacters": false,

    // Don't accept suggestions when pressing enter
    "editor.acceptSuggestionOnCommitCharacter": false,

    // Let there be light.
    "workbench.colorTheme": "Visual Studio Light",

    // Slight color adjustments to make the UI harmonize
    // better with the light syntax theme.
    "workbench.colorCustomizations": {
        "activityBar.background": "#d0d0d0",
        "activityBar.foreground": "#505050",
        "editorCursor.foreground": "#4682B4",
        "editorCursor.background": "#ebebeb",
        "editorGutter.background": "#ebebeb",
        "titleBar.activeBackground": "#405060",
        "titleBar.activeForeground": "#fff",
        "titleBar.inactiveForeground": "#a0a0a0",
        "titleBar.inactiveBackground": "#ebebeb"

    // An editor should never, EVER assume it knows better than
    // me how my code is to be formatted at any given moment.
    "editor.formatOnPaste": false,
    "editor.formatOnType": false,

    // I wonder if this makes any difference...
    "telemetry.enableTelemetry": false,
    "telemetry.enableCrashReporter": false,

    // Only highlight matching brackets when the cursor is
    // actually positioned at a bracket.
    "editor.matchBrackets": "near",

    // There's a new serif in town.
    "editor.fontFamily" : "Go Mono",
    "editor.fontSize": 16,

    // Full file path in window titlebar.
    "window.title": "${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}",

    // This makes autoindent work as expected, E.G. the indentation
    // level of the last line is kept, instead of the editor adding
    // spurious extra indentation after an opening bracket, etc.
    "editor.autoIndent": "keep",

    // Never auto close opened tags in HTML or JSX.
    "html.autoClosingTags": false,
    "javascript.autoClosingTags": false,

    // Voodoo setting. Should probably be removed.
    "editor.quickSuggestionsDelay": 1000000000,

    // Don't suggest stuff.
    "editor.suggest.showClasses": false,
    "editor.suggest.showConstants": false,
    "editor.suggest.showConstructors": false,
    "editor.suggest.showEnumMembers": false,
    "editor.suggest.showEnums": false,
    "editor.suggest.showEvents": false,
    "editor.suggest.showFields": false,

    // Hide most tooltips.
    "editor.hover.enabled": false,

    // Honor E.G. .gitignore
    "search.useGlobalIgnoreFiles": true,