Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command-hover tooltip in VSCode VIM without using mouse

I recently discovered that there is an expanded hover tooltip in VSCode vim that can be seen by hovering over a token while holding the command key. In my case I'm particularly interested in seeing typescript type definitions that are available in this tooltip, but not in the basic hover tooltip.

I use the VSCode Vim extension, so use 'gh' to trigger these tooltips without using a mouse, but holding command+'gh' doesn't produce the desired effect (it triggers other command modifier hotkeys).

This is an example of the tooltip that loads from 'gh':

Hover without command

This is an example of the expanded tooltip from holding command while hovering:

Hover with command

like image 914
Ben Zittlau Avatar asked Jun 17 '20 18:06

Ben Zittlau


People also ask

How do you hover in Visual Studio code?

Open the command palette and type "show hover" to find the command. The default shortcut does not work for me, so I added an override of Ctrl + Space + H . To add your own override, open the command palette and type "keyboard shortcuts". That opens the shortcut editor.

How do I disable VS code in tooltip?

Type “editor. hover. enable” into the search field then check/uncheck the checkbox associated with “Controls whether the hover is shown.” to enable/disable the suggestion tooltip on hover.


1 Answers

I believe this expanded hover is the VS Code command ID editor.action.showDefinitionPreviewHover. There is no binding for this built in to VSCodeVim as of this writing, so you can define your own in your settings:

"vim.normalModeKeyBindingsNonRecursive": [
  {
    "before": ["g", "H"],
    "commands": [{ "command": "editor.action.showDefinitionPreviewHover" }]
  }
]
like image 76
ches Avatar answered Oct 11 '22 10:10

ches