Reputation: 4303
Is there a keyboard shortcut to trigger the information tooltip that is typically shown when hovering over items in VS Code with the mouse?
Example hover tooltip:
Upvotes: 100
Views: 40335
Reputation: 168
A simple way, which is also on the official site of Microsoft, is the simultaneous use of ctr + k + i are together.
Just make sure the cursor is on the desired area
Upvotes: -1
Reputation: 12545
2021 Update- As far as I can tell, the new command that we're all looking for here is:
"Show Definition Preview Hover"
The shortcut for that command was unbound. I set it back to ctrl+h, which is what worked for me in the past. Here's more info-
https://newbedev.com/how-to-trigger-documentation-popup-in-vscode
Upvotes: 8
Reputation: 1196
If you're using the VSCodeVim plugin, you can use gh
to show the tooltip.
Upvotes: 107
Reputation: 4699
The corresponding cmd name in VS Keybindings is editor.action.showHover
. On mac for me the key combo was:
⌘ Command + k
⌘ Command + i
You can also access it through your command palette by typing show hover
. It will show you the current keybinding and you can execute it as well.
If you would like you can remap it like this:
{
"key": "ctrl+e",
"command": "editor.action.showHover",
"when": "editorTextFocus"
}
With that, if your cursor is within an error/warning squiggly line, you can hit ctrl+e
to show what you would normally see with hover.
To make the box disappear, I am having to hit escape. It would be cool if there was a editor.action.toggleHover
or something like that, but in the meantime this works great!
Upvotes: 52
Reputation: 37798
You could use Ctrl + Shift + M to show all the errors:
and then use Ctrl + . to show the list of the Quick Fixes.
Upvotes: 5