14

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

Kent
  • 189,393
  • 32
  • 233
  • 301
Ben Zittlau
  • 2,345
  • 1
  • 21
  • 30

1 Answers1

11

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" }]
  }
]
ches
  • 6,382
  • 2
  • 35
  • 32
  • For me this shows the preview, but then I can no longer navigate unless I press escape. – Dylan Landry Jun 09 '22 at 22:04
  • I think it solution is not perfect cause you can't roll in the hover and you can't use mouse to roll it as well(the hover will disappear). – MrZ Aug 26 '22 at 12:10