返回博客

Vscode 解决 GitHub Copilot 与 Markdown All in One 插件冲突问题

解决 Vscode 中 GitHub Copilot 与 Markdown All in One 插件的 Tab 键冲突问题,使 Tab 键可以正常用于代码补全。

GitHub Copilot 很好用,但是在和 Markdown all in one 一起用的时候,不能按 Tab 自动补全,打出来的是空格。

翻了一下 github,找到这篇文章

https://github.com/github/feedback/discussions/7861

解决方法如下,我这儿做一下转载

https://dxrf.com/blog/2021/09/28/gh-copilot-markdown-all-in-one-extension/

  • 按快捷键 (Ctrl+Shift+P)
  • 选择 Open Keyboard Shortcuts (JSON)
  • 粘贴以下代码并保存
[
  {
    "key": "tab",
    "command": "markdown.extension.onTabKey",
    "when": "editorTextFocus && !inlineSuggestionVisible && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
  },
  {
    "key": "tab",
    "command": "-markdown.extension.onTabKey",
    "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
  }
]