Command-hover tooltip in VSCode VIM without using mouse [duplicate]
Asked Answered
A

1

18

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

Animatism answered 17/6, 2020 at 18:46 Comment(1)
Just learned the gh thing, thanks a lot!Hadj
C
14

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" }]
  }
]
Charlean answered 14/11, 2021 at 6:21 Comment(2)
For me this shows the preview, but then I can no longer navigate unless I press escape.Geyser
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).Beseem

© 2022 - 2024 — McMap. All rights reserved.