我不想在 Visual Studio Code 中对 Markdown 文件进行单词补全,如何禁用它?理想情况下,仅适用于 Markdown,但在最坏的情况下,即使是全局切换也会很好。
最佳答案
VS Code 中的 IntelliSense 建议可以配置 globally or per each workspace和截至 1.9 per file-type (language) ,使用 editor.quickSuggestions
, editor.acceptSuggestionOnEnter
和 editor.suggestOnTriggerCharacters
settings .
// Controls if quick suggestions should show up or not while typing
"editor.quickSuggestions": true,
文件类型设置 (首选,从 1.9 版本开始)
打开 Command Palette按 F1 并运行
Configure language specific settings
命令,然后选择 Markdown
.将打开一个新的编辑器 Pane ,您可以在其中放置这些设置:
// Place your settings in this file to overwrite the default settings
{
"[markdown]": {
"editor.quickSuggestions": false
}
}
这样,您将仅为 Markdown 文件禁用 IntelliSense。
全局
开通 Command Palette按 F1,输入
open user settings
并按 Enter。将打开一个新的编辑器 Pane ,您可以在其中放置这些设置:// Place your settings in this file to overwrite the default settings
{
"editor.quickSuggestions": false
}
工作区
Workspace settings允许设置自定义设置而不将它们应用于您的其他 VS Code 项目。工作区设置文件位于
.vscode
下项目中的文件夹。开通 Command Palette按 F1,输入
open workspace settings
并按 Enter。当您可以放置与上面列出的相同的剪辑时,将打开一个新的编辑器 Pane 。我不知道目前是否可以将设置与选定的文件类型相关联。
其他配置选项
除了
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
关于intellisense - 如何在 VS Code 中为 Markdown 禁用 IntelliSense?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38832753/