Skip to content

Instantly share code, notes, and snippets.

@baniol
Last active November 10, 2022 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baniol/9017bc8e721730185a68c964b73a302d to your computer and use it in GitHub Desktop.
Save baniol/9017bc8e721730185a68c964b73a302d to your computer and use it in GitHub Desktop.
Toggle inlay hints vsc
{
"key": "alt+f", // key to press to activate command
"command": "settings.cycle", // `settings.cycle` is the command that's actually being run, from the extension `hoovercj.vscode-settings-cycler`
"when": "editorTextFocus && editorLangId == 'rust'", // this keybinding is only active when (editor is in focus) and (the language is `rust`)
"args": { // these are the arguments passed to `settings.cycle`
"id": "rust-toggle-inlay-hints", // must be unique
"overrideWorkspaceSettings": true,
"values": [ // Note: use the same settings in each values object
{
"rust-analyzer.inlayHints.enable": false // sets the inlay hints off
},
{
"rust-analyzer.inlayHints.enable": true // sets the inlay hints on
}
]
}
},
// Place your key bindings in this file to override the defaults
[
{
"key": "alt+f",
"command": "toggle",
"when": "editorTextFocus",
"args": {
"id": "toggle_inlay_hints",
"value": [
{
"editor.inlayHints.enabled": "on"
},
{
"editor.inlayHints.enabled": "off"
}
]
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment