I would like to have a quick command button displayed on my Menu bar to turn on/off the Code Lens. I understand there is a keyboard shortcut available for it:
The EditorContextMenus.CodeLens.CodeLensOptions command for keyboard shortcut, but I cannot make it as a quick command button.
It will be very awesome I can see a quick button on my VS Menu to quickly toggle it. (instead of remember it as keyboard shortcut)
How can I achieve this?
Apparently this is as hard as it looks - even though the command definitely exists, it is nowhere to be found in any of the menus when clicking "Add Command...". But this is a fixable oversight.
Here's what I did:
%LOCALAPPDATA%\Microsoft\VisualStudio\<version>\Settings\CurrentSettings.vssettings
(note: some diff tools like Beyond Compare have a built-in XML formatter)
Cmd
andCmdPri
to be that of the removed CodeLens command:And voila - the command is now residing in the appropriate toolbar and you can move/modify it as you please:

You can now also go and reset the original CodeLens menu that you have removed it from.