I don't want word completion for Markdown files in Visual Studio Code, how do I disable it? Ideally, for Markdown only but in the worst case, even a global switch would be good.
问题:
回答1:
IntelliSense suggestions in VS Code can be configured globally or per each workspace and as of 1.9 per file-type (language), using the editor.quickSuggestions
, editor.acceptSuggestionOnEnter
and editor.suggestOnTriggerCharacters
settings.
// Controls if quick suggestions should show up or not while typing
"editor.quickSuggestions": true,
File-type settings (preferred, as of 1.9 release)
Open the Command Palette by pressing F1 and run the Configure language specific settings
command, then select Markdown
.
A new editor pane will open where you can place those settings:
// Place your settings in this file to overwrite the default settings
{
"[markdown]": {
"editor.quickSuggestions": false
}
}
This way you'll disable IntelliSense for markdown files only.
Global
Open Command Palette by pressing F1, type open user settings
and press Enter. A new editor pane will open where you can place those settings:
// Place your settings in this file to overwrite the default settings
{
"editor.quickSuggestions": false
}
Workspace
Workspace settings allows to set custom settings without applying them to your other VS Code projects. The workspace settings file is located under the .vscode
folder in your project.
Open Command Palette by pressing F1, type open workspace settings
and press Enter. A new editor pane will open when you can place same snipped as listed above.
I don't know if it's currently possible to associate settings with selected filetypes.
Other options to configure
In addition to editor.quickSuggestions
several other options can be changed to further customize how IntelliSense works:
// 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:
In addition to what @JakubS said, there are two more settings that will help eliminate 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,
The editor.autoClosingBrackets
option will stop Visual Studio Code from automatically inserting a closing parenthesis, bracket, brace, single quote, double quote, etc.
The editor.suggestOnTriggerCharacters
option will stop the auto-complete window from appearing when you type a dollar sign or dot.
All together, here's what I use:
// 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