Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
Last active November 9, 2022 21:42
Show Gist options
  • Save ninmonkey/be098e95330e1442c9400506db11d90f to your computer and use it in GitHub Desktop.
Save ninmonkey/be098e95330e1442c9400506db11d90f to your computer and use it in GitHub Desktop.
Some Custom VS Code Settings.md
  • misc
  • PSScriptAnalyzer\Invoke-Formatter supports piped input and new rules
  • integratedConsole.startInBackground completely hides terminal

1.71 +

Support for common alternative current working directory sequences:

OSC 6 ; scheme://<cwd> ST, OSC 1337 ; CurrentDir=<cwd> ST, OSC 9 ; 9 ; <cwd> ST

1.70 +

new inTerminalRunCommandPicker context key

allows setting up a keybinding like Ctrl+R to go to the next match. For example, the following keybindings are now a fairly complete replacement for your shell's reverse search, with Ctrl+Alt+R as a fallback to the old behavior

{ "key": "ctrl+r",     "command": "workbench.action.terminal.runRecentCommand", "when": "terminalFocus" },
{ "key": "ctrl+alt+r", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0012"/*^R*/ }, "when": "terminalFocus" },
{ "key": "ctrl+r",     "command": "workbench.action.quickOpenNavigateNextInViewPicker", "when": "inQuickOpen && inTerminalRunCommandPicker" },
{ "key": "ctrl+c",     "command": "workbench.action.closeQuickOpen", "when": "inQuickOpen && inTerminalRunCommandPicker" },

https://code.visualstudio.com/assets/updates/1_70/terminal-si-run-recent-command.gif

[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"
if ($env:TERM_PROGRAM -eq 'vscode' -and $manualVSCodeIntegrationScript) {    
  . "$(code.cmd --locate-shell-integration-path pwsh)" # Note: is this only required if injection fails?
}

1.69 +

more titlebars

Shell Integration

user settings.json

"terminal.integrated.shellIntegration.enabled": true

user keybindings.json

 /* ref: <he below replaces Ctrl+R with runRecentCommand, with Ctrl+Alt+R available to fallback to the shell's regular behavior:> */
    {
        "key": "ctrl+r",
        "command": "workbench.action.terminal.runRecentCommand",
        "when": "terminalFocus"
    },
    // Allow ctrl+r again to go to the next command in the quick pick
    {
        "key": "ctrl+r",
        "command": "workbench.action.quickOpenNavigateNextInViewPicker",
        "when": "inQuickOpen && inTerminalRunCommandPicker"
    },
    // Fallback to the shell's native ctrl+r
    {
        "key": "ctrl+alt+r",
        "command": "workbench.action.terminal.sendSequence",
        "args": {
            "text": "\u0012" /*^R*/
        },
        "when": "terminalFocus"
    },

Emmet

inline emmet suggest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment