Visual Studio代码禁用自动引用

roy*_*ce3 14 visual-studio-code

如何禁用自动引用功能?

当我按下'或'键时,我不想让它自动在任何地方插入另一个.无论它们多么聪明,它只是让我觉得"不可预测"并分散了我的注意力.做.

我输入的速度超过100,我真的不需要帮助击中'或'键.

我尝试了以下设置,但没有一个禁用此不良行为:

{
    "editor.autoClosingBrackets": false,
    "editor.wordWrap": "off",
    "html.autoClosingTags": false,
    "editor.formatOnType": false,
    "editor.suggestOnTriggerCharacters": false,
    "editor.acceptSuggestionOnEnter": "off",
}
Run Code Online (Sandbox Code Playgroud)

Dav*_*aun 17

把它放在你的用户设置中:

"editor.autoClosingQuotes": "never"
Run Code Online (Sandbox Code Playgroud)


pkE*_*xec 17

除了接受的答案之外,我还必须在首选项中禁用“HTML:自动创建报价”(搜索“报价”)

  • 我同意那个。当我打字时自动输入我的代码是......烦人的。我不知道为什么他们认为这是个好主意。 (4认同)

小智 14

这是一个 GUI-如何更改它:

  1. 打开设置对话框:
    • Strg + ,或用鼠标导航File | Settings
  2. 更改以下值:
    • editor.autoClosingQuotes到想要的never
  3. 就是这样,没有第 3 步 - 只支持我的屏幕截图答案..

通过 GUI 更改设置


Ale*_*lex 7

编辑:从vscode 1.27.0

"editor.autoClosingQuotes": "never",
"editor.autoSurround": "never",// When the word is selected
Run Code Online (Sandbox Code Playgroud)

我猜您可以像这样(keybindings.json)来“键入”它们:

{
    "key": "'",
    "command": "editor.action.insertSnippet",
    "args": {
        "snippet": "'"
    },
    "when": "editorTextFocus && !editorReadonly"
},
Run Code Online (Sandbox Code Playgroud)

  • 与“ editor.autoClosingQuotes”:“从不”设置不同,当选择一个单词并按引号键时,此设置也适用。 (2认同)