You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode:如何将MDN参考链接设置为双击触发

Got it, I totally get the frustration of accidentally clicking those MDN links when you just meant to hover over content for a quick reference! Here's how you can switch the trigger to double-click without ditching the feature entirely:

Step-by-Step Solution

First, we’ll disable the default behavior that opens links on a single click:

  • Open VS Code Settings (press Ctrl+, on Windows/Linux, Cmd+, on Mac)
  • Search for the setting editor.hover.openOnClick
  • Toggle the switch to false — this stops accidental single-clicks from launching the MDN link

Next, we’ll set up a double-click shortcut to intentionally open the link when you want to:

  • Open the Keyboard Shortcuts editor (press Ctrl+K Ctrl+S on Windows/Linux, Cmd+K Cmd+S on Mac)
  • Click the small file icon in the top-right corner of the shortcuts editor to open your keybindings.json file
  • Paste the following configuration into the file:
{
    "key": "doubleclick",
    "command": "editor.action.openHoverLink",
    "when": "hoverVisible && editorTextFocus"
}
  • Save the file, and you’re all set!

From now on, hovering over content will still bring up the MDN reference popup, but single-clicks won’t do anything. A double-click will open the link exactly when you intend it to.

内容的提问来源于stack exchange,提问作者T S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.01 03:12:41