如何禁用VSCode的双引号自动成对输入与匹配删除功能?
Absolutely! I’ve run into this exact annoyance when writing Scala multi-line strings in VS Code 1.23.1 too—nothing breaks your flow faster than fighting auto-completed quotes when you’re trying to type """foo""". Here are a few solid solutions tailored to your needs:
Option 1: Disable Auto-Quote Pairing Only for Scala
This is the cleanest approach if you still want auto-pairing for other languages (like JavaScript or Python) but need it gone for Scala.
- Open VS Code settings: Press
Ctrl+,(Windows/Linux) orCmd+,(Mac) - Search for
editor.autoClosingQuotes - Click the
Edit in settings.jsonlink at the top right of the setting panel - Add this block to your JSON config:
"[scala]": { "editor.autoClosingQuotes": "never" }
Save the file, and VS Code will stop auto-completing double quotes entirely when you’re in Scala files.
Option 2: Fine-Tune Pairing Rules to Support Triple Quotes
If you still want auto-pairing for single double quotes (like in val x = "bar"), you can tweak the auto-closing rules to avoid interfering with triple quotes.
- Open your
settings.jsonusing the same steps from Option 1 - Add this custom configuration block:
"[scala]": { "editor.autoClosingPairs": [ {"open": "'", "close": "'"}, {"open": "(", "close": ")"}, {"open": "[", "close": "]"}, {"open": "{", "close": "}"}, // Only auto-close double quotes if we're NOT inside a string already {"open": "\"", "close": "\"", "notIn": ["string"]} ] }
This way, when you type your first ", it’ll auto-complete to "" (great for single-line string literals), but once you’re inside that string context, typing more " won’t trigger auto-pairing—perfect for building out triple quotes without interference.
Quick Temporary Workaround
If you need a quick fix without changing your settings for a one-off case:
- Type your first
"(it’ll auto-complete to"") - Press
Ctrl+Z(Windows/Linux) orCmd+Z(Mac) immediately to undo the auto-pair - Now you can type the remaining two
"characters normally to make"""foo"""
内容的提问来源于stack exchange,提问作者Knows Not Much

