如何禁用VS Code中的IntelliSense以进行Markdown?

Bor*_*ard 30 intellisense visual-studio-code

我不想在Visual Studio Code中为Markdown文件完成单词,如何禁用它?理想情况下,仅对于Markdown,但在最坏的情况下,即使是全局切换也会很好.

Jak*_*iec 48

在VS代码智能感知的建议可以被配置全局或每每个工作区和作为1.9文件类型(语言),使用editor.quickSuggestions,editor.acceptSuggestionOnEntereditor.suggestOnTriggerCharacters 设置.

// Controls if quick suggestions should show up or not while typing
"editor.quickSuggestions": true,
Run Code Online (Sandbox Code Playgroud)

文件类型设置(首选,截至1.9版)

按下并运行命令打开命令调色板,然后选择.将打开一个新的编辑器窗格,您可以在其中放置这些设置:F1Configure language specific settingsMarkdown

// Place your settings in this file to overwrite the default settings
{
  "[markdown]": {
    "editor.quickSuggestions": false
  }
}
Run Code Online (Sandbox Code Playgroud)

这样,您将仅为markdown文件禁用IntelliSense.

全球

按,打开命令选项板F1,键入open user settings并按Enter.将打开一个新的编辑器窗格,您可以在其中放置这些设置:

// Place your settings in this file to overwrite the default settings
{
    "editor.quickSuggestions": false
}
Run Code Online (Sandbox Code Playgroud)

工作区

工作区设置允许设置自定义设置,而不将其应用于其他VS Code项目.工作区设置文件位于.vscode项目的文件夹下.

按,打开命令选项板F1,键入open workspace settings并按Enter.当您可以放置​​上面列出的相同剪辑时,将打开一个新的编辑器窗格.

我不知道目前是否可以将设置与选定的文件类型相关联.

其他配置选项

除了editor.quickSuggestions可以更改其他几个选项以进一步自定义IntelliSense的工作方式:

// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": false,

// Controls if suggestions should be accepted with "Enter" - in addition to "Tab". Helps to avoid ambiguity between inserting new lines and accepting suggestions.
"editor.acceptSuggestionOnEnter": false,

// Controls the delay in ms after which quick suggestions will show up.
"editor.quickSuggestionsDelay": 10,

// Enable word based suggestions
"editor.wordBasedSuggestions": false,

// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,

// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": false
Run Code Online (Sandbox Code Playgroud)

  • @FrankNocke 纯文本是一种语言,称为“PlainText”,它涵盖“.txt”文件 (3认同)
  • 对于那些希望像我一样禁用`.txt`文件的intellisense的人来说,这对我有用:`"[plaintext]":{"editor.quickSuggestions":false}` (2认同)
  • @Frank Nocke 的评论(现在?)错误,对于 `.txt` ,类型是纯文本,请参阅 @MrDustpan 的评论,谢谢!您可以执行以下操作: [Ctl-Shift-P] / 配置特定于语言的设置... / [Enter] / 纯文本 / [Enter] / `"editor.quickSuggestions": false` / [Ctl-S] (2认同)
  • 如果您尝试使用“.mdx”文件执行此操作,请注意您必须使用“[mdx]”而不是“[markdown]”。 (2认同)

geo*_*lee 7

除了@JakubS 所说的之外,还有两个设置可以帮助消除 IntelliSense:

// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,

// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": false,
Run Code Online (Sandbox Code Playgroud)

editor.autoClosingBrackets选项将阻止 Visual Studio Code 自动插入右括号、方括号、大括号、单引号、双引号等。

editor.suggestOnTriggerCharacters当您键入美元符号或点时,该选项将阻止自动完成窗口出现。

总之,这是我使用的:

// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": false,

// Controls if suggestions should be accepted with "Enter" - in addition to "Tab". Helps to avoid ambiguity between inserting new lines and accepting suggestions.
"editor.acceptSuggestionOnEnter": false,

// Controls the delay in ms after which quick suggestions will show up.
"editor.quickSuggestionsDelay": 10,

// Enable word based suggestions
"editor.wordBasedSuggestions": false,

// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,

// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": false
Run Code Online (Sandbox Code Playgroud)