Skip to content

Instantly share code, notes, and snippets.

@DV8FromTheWorld
Last active December 8, 2022 17:36
Show Gist options
  • Save DV8FromTheWorld/c60c4127aa28233819ac68c90d09ae75 to your computer and use it in GitHub Desktop.
Save DV8FromTheWorld/c60c4127aa28233819ac68c90d09ae75 to your computer and use it in GitHub Desktop.
VS Code tweaks

Settings

Just straight to Complete Settings Files if you just wanna completely copy my setup

Key Bindings

Please note, these are my custom assigned keybindings. The keybinds below are not the default keybinds for these controls.

Name Keybind Description
Go Back Cmd+Opt+LeftArrow Navigates to your previous cursor position. Will also navigate between editor panes. Extremely useful for keeping context while exploring code. 1000% recommend
Go Forward Cmd+Opt+RightArrow Navigates to your next cursor position (after you use GoBack). Will also navigate between editor panes. Extremely useful for keeping context while exploring code.
Reveal Active File in Explorer View Cmd+F1 Scrolls the explorer view to the current editor file for easy context discovery
Git: Open file Cmd+DownArrow Allows you to open the source file when looking at a git diff that was opened via clicking on a modified file in the Git commit sidebar tool-window. Note, you may need to unbind the cursorBottom keybind

Explorer Tree

I have a lot of problems visually parsing the explorer tree in the default state. As such, here are the changes I make to it to make it easier for me.

How-to

You can find the individual walkthroughts below, but if you just want to shortcut straight to the settings, put these in your JSON settings file.

"workbench.colorCustomizations": {
    "tree.indentGuidesStroke": "#ffffff"
},
"workbench.tree.indent": 25,
"workbench.tree.renderIndentGuides": "always",

Images

Default Customized
image

Tree Indentation

I find the default explorer tree's indention guides to be too small to see, so I change the tree indention.

How-to

Via UI

  1. Open Finder (Cmd-Shift-P)
  2. find "Open Settings (UI)
  3. search "tree"
  4. find "Workbench: Tree: Indent"
  5. Update to a value to you like (remember to save) i. I personally use 25

Tree Guidelines - Always Render

I want the guidelines to always show up, not just on hover, so that I can understand scoping better

How-to

Via UI

  1. Open Finder (Cmd-Shift-P)
  2. find "Open Settings (UI)
  3. search "tree"
  4. find "Workbench: Tree: Render Guide Lines"
  5. true

Tree Guidelines - Highlighted Guide line

I like there to be some visual indication as to what specific folder I'm in so I can easily hold visual context. As such, I want the guide line for the active folder to be highlighted. In contrast, all the other guidelines are a dimmer color.

How-to

Via UI

  1. Open Finder (Cmd-Shift-P)
  2. find "Open Settings (UI)
  3. search "tree"
  4. find "Workbench: Guides: Highlight Active Indentation
  5. true

Tree Guide lines - Color Changes

I find the default guide line colors to be too dark and difficult to see. I want them to pop more. As a note, there is a single color that controls both the Active indentation guide line color and the non-active guide line color. the non-active guide line color is just an opacity reduction of the active indentation guide line.

Since I'm on dark theme I decided to just make the color be white. Note, this setting is not available via UI. You must update the JSON.

How-to

Via JSON

  1. Open Finder (Cmd-Shift-P)
  2. find "Open Settings (JSON)
  3. Add the following code to your json configuration i. NOTE: You might already have workbench.colorCustomizations so you'll need to merge the blocks
"workbench.colorCustomizations": {
  "tree.indentGuidesStroke": "#ffffff"
},

complete settings files

settings.json

{
    "workbench.colorTheme": "Visual Studio Dark",
    "files.autoSave": "afterDelay",
    "editor.unfoldOnClickAfterEndOfLine": true,
    "editor.showFoldingControls": "always",
    "workbench.editor.enablePreview": false,
    "diffEditor.renderSideBySide": false,
    "git.suggestSmartCommit": false,
    "remote.portsAttributes": {
        "443": {
            "protocol": "https"
        },
        "8443": {
            "protocol": "https"
        }
    },
    "remote.autoForwardPorts": false,
    "workbench.colorCustomizations": {
        "tree.indentGuidesStroke": "#ffffff"
    },
    "workbench.tree.indent": 25,
    "workbench.tree.renderIndentGuides": "always",
    "diffEditor.ignoreTrimWhitespace": false,
}

keybindings.json

[
    {
        "key": "shift shift",
        "command": "workbench.action.quickOpen"
    },
    {
        "key": "shift+cmd+f",
        "command": "workbench.action.findInFiles"
    },
    {
        "key": "shift+cmd+f",
        "command": "-workbench.action.findInFiles"
    },
    {
        "key": "shift+cmd+f",
        "command": "-workbench.view.search",
        "when": "workbench.view.search.active && neverMatch =~ /doesNotMatch/"
    },
    {
        "key": "shift+cmd+f",
        "command": "filesExplorer.findInFolder",
        "when": "explorerResourceIsFolder && explorerViewletVisible && filesExplorerFocus && !inputFocus"
    },
    {
        "key": "shift+alt+f",
        "command": "-filesExplorer.findInFolder",
        "when": "explorerResourceIsFolder && explorerViewletVisible && filesExplorerFocus && !inputFocus"
    },
    {
        "key": "cmd+f1",
        "command": "workbench.files.action.showActiveFileInExplorer"
    },
    {
        "key": "cmd+y",
        "command": "redo"
    },
    {
        "key": "shift+cmd+z",
        "command": "-redo"
    },
    {
        "key": "alt+cmd+right",
        "command": "-workbench.action.terminal.focusNextPane",
        "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
    },
    {
        "key": "alt+cmd+right",
        "command": "-workbench.action.nextEditor"
    },
    {
        "key": "alt+cmd+left",
        "command": "-workbench.action.terminal.focusPreviousPane",
        "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
    },
    {
        "key": "alt+cmd+left",
        "command": "-workbench.action.previousEditor"
    },
    {
        "key": "alt+cmd+left",
        "command": "workbench.action.navigateBack"
    },
    {
        "key": "ctrl+-",
        "command": "-workbench.action.navigateBack"
    },
    {
        "key": "alt+cmd+right",
        "command": "workbench.action.navigateForward"
    },
    {
        "key": "ctrl+shift+-",
        "command": "-workbench.action.navigateForward"
    },
    {
        "key": "cmd+down",
        "command": "-cursorBottom",
        "when": "textInputFocus"
    },
    {
        "key": "cmd+down",
        "command": "git.openFile"
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment