Command-hover tooltip in VSCode VIM without using mouse

Viewed 2253

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

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" }]
  }
]
Related