我不想在Visual Studio Code中为Markdown文件完成单词,如何禁用它?理想情况下,仅对于Markdown,但在最坏的情况下,即使是全局转换也会很好。
答案 0 :(得分:44)
可以使用editor.quickSuggestions
,editor.acceptSuggestionOnEnter
和editor.suggestOnTriggerCharacters
globally or per each workspace配置VS代码中的智能感知建议1.9 per file-type (language)和settings。
// Controls if quick suggestions should show up or not while typing
"editor.quickSuggestions": true,
文件类型设置(首选,自1.9版本起)
按 F1 打开Command Palette并运行Configure language specific settings
命令,然后选择Markdown
。
将打开一个新的编辑器窗格,您可以在其中放置这些设置:
// Place your settings in this file to overwrite the default settings
{
"[markdown]": {
"editor.quickSuggestions": false
}
}
这样,您只能为markdown文件禁用IntelliSense。
<强>全球强>
按 F1 打开Command Palette,输入open user settings
,然后按 Enter 。将打开一个新的编辑器窗格,您可以在其中放置这些设置:
// Place your settings in this file to overwrite the default settings
{
"editor.quickSuggestions": false
}
<强>工作区强>
Workspace settings允许设置自定义设置,而不将其应用于其他VS Code项目。工作区设置文件位于项目的.vscode
文件夹下。
按 F1 打开Command Palette,输入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
答案 1 :(得分:4)
除了@JakubS所说的,还有两个设置可以帮助消除智能感知:
// 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,
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
答案 2 :(得分:0)
如果降价警告也令人分心,并且您想暂时将其禁用,则可以使用;
CTRL/COMMAND+SHIFT+P
Toggle linting by markdownlint on/off (temporarily)
当您认为完成文档后就可以启用它。