keyboard shortcuts - How to open hover links without using a mouse in VS Code with the Vim extension installed? - Stack Overflow

admin2025-05-01  0

While programming in JavaScript / TypeScript in VS Code, I often need to follow documentation links of functions, which appear on mouse hover. I want to be able to do this without using a mouse.

Here's a screenshot showing the hover link / documentation link I'm referring to (the text saying "MDN Reference").

I have the Vim extension installed, so I'm able to use the keyboard shortcut gh in normal mode to simulate the mouse hover action when the cursor is on the function, which opens a popup containing the documentation link. But after this step, I couldn't open the link without a mouse.

In VS Code, I searched File -> Preferences -> Keyboard Shortcuts for VS Code commands related to following links in hover popups using keywords "hover", "tooltip", "popup", "peek", but found nothing relevant.

I also checked VSCodeVim repository README and didn't find any helpful information.

My goal is to open the documentation link of a function displayed in VS Code's popup window, (triggered by cursor hover) in a browser, with or without the addition of other VS Code extensions.

While programming in JavaScript / TypeScript in VS Code, I often need to follow documentation links of functions, which appear on mouse hover. I want to be able to do this without using a mouse.

Here's a screenshot showing the hover link / documentation link I'm referring to (the text saying "MDN Reference").

I have the Vim extension installed, so I'm able to use the keyboard shortcut gh in normal mode to simulate the mouse hover action when the cursor is on the function, which opens a popup containing the documentation link. But after this step, I couldn't open the link without a mouse.

In VS Code, I searched File -> Preferences -> Keyboard Shortcuts for VS Code commands related to following links in hover popups using keywords "hover", "tooltip", "popup", "peek", but found nothing relevant.

I also checked VSCodeVim repository README and didn't find any helpful information.

My goal is to open the documentation link of a function displayed in VS Code's popup window, (triggered by cursor hover) in a browser, with or without the addition of other VS Code extensions.

Share Improve this question asked Jan 2 at 14:19 NaBrHClNaBrHCl 331 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I can open a hyperlink from the hover with few keystrokes (g, h, tab, tab, Enter which can be mapped with vscodevim) thanks to this answer.

Note I have this keybind on "settings.json" : "vim.normalModeKeyBindingsNonRecursive": [ { "before": ["g", "h"], "commands": ["editor.action.showDefinitionPreviewHover"] } ]

转载请注明原文地址:http://anycun.com/QandA/1746115104a91878.html