Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio Code to use auto-complete on Plain Text

Is there a way to stop Visual Studio Code to autocomplete words, or to stop inserting snippets when working on a "PlainText" document?

I love VSC, but I use a lot of plain-text to take notes and so on. I don't want VSC to turn a 'sentence' like "I was" into:

I <i class="fas fa-car-wash    "></i>

just because I pressed [Enter] after the word 'was'.

I can kill the autocomplete in total, but I like it in code files. I just don't want it when the type is set to plaintext.

like image 895
Cryothic Avatar asked Sep 01 '25 10:09

Cryothic


2 Answers

Look at language-specific settings. See https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings

"[plaintext]": {
  "editor.suggest.showSnippets": false,
  "editor.suggest.showWords": false,
  "editor.acceptSuggestionOnCommitCharacter": false,
  "editor.acceptSuggestionOnEnter": "off"
},

To quickly fix, open a text file in vscode, click on "Plain Text" in the bottom left, then click "Configure 'Plain Text' language based settings..." in the menu that appears. It'll open a .json file in another tab and you can edit the settings there. (from @JustasidequestNPC comment)

like image 80
Mark Avatar answered Sep 03 '25 16:09

Mark


Try setting "editor.wordBasedSuggestions": false.

You can also play around with what VSCode can suggest in Settings:

Ctrl + Shift + P => Preferences: Open Settings (UI) => Text Editor => Suggestions

like image 27
Anton Zolotukhin Avatar answered Sep 03 '25 15:09

Anton Zolotukhin