Ben Walker
Ben Walker

Reputation: 938

VSCode: Keyboard shortcuts for modifying user settings

I like the idea of CodeLens, VSCode's plugin that tells you reference counts on all your functions & variables. However, when I'm scanning code, the extra vertical margin added to include the "X references" line annoys me enough that I've disabled it. This is a shame, because it's useful information.

I'd like to be able to control whether CodeLens is active via keyboard shortcut. There seem to be no "editor.action.toggleCodeLens" in the keybindings, though, and trying

{ "key": "ctrl+l", "command": "editor.codeLens = false" }

or

{ "key": "ctrl+l", "command": "editor.codeLens = !editor.codeLens" }

produces the error command 'editor.codeLens = false' not found. Is there a way to do this?

Upvotes: 3

Views: 1037

Answers (1)

Matt Bierner
Matt Bierner

Reputation: 65175

Try this extensions: https://marketplace.visualstudio.com/items?itemName=rebornix.toggle

It allows you to setup custom keybindings to toggle any VSCode setting

Upvotes: 4

Related Questions