Keyboard shortcut to show hover tooltip

Visual Studio-Code

Visual Studio-Code Problem Overview


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:

Example hover tooltip

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Press Ctrl + K, Ctrl + I, that's what you want

Solution 2 - Visual Studio-Code

If you're using the VSCodeVim plugin, you can use gh to show the tooltip.

Solution 3 - Visual Studio-Code

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!

Solution 4 - Visual Studio-Code

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

Solution 5 - Visual Studio-Code

You could use Ctrl + Shift + M to show all the errors:

enter image description here

and then use Ctrl + . to show the list of the Quick Fixes.

Solution 6 - Visual Studio-Code

Show Hover is the command, Ctrl+K Ctrl+I is the keybinding.

Solution 7 - Visual Studio-Code

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionQuestionAndAnswerView Question on Stackoverflow
Solution 1 - Visual Studio-Codenewbee vscodeView Answer on Stackoverflow
Solution 2 - Visual Studio-CodealaqView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeprotoEvangelionView Answer on Stackoverflow
Solution 4 - Visual Studio-CodechrismarxView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeNasreddineView Answer on Stackoverflow
Solution 6 - Visual Studio-CodemdmundoView Answer on Stackoverflow
Solution 7 - Visual Studio-Codeabolfazl maheraniView Answer on Stackoverflow