Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable auto-closing single quotations inside strings?

I like the functionality of autoclosing brackets, quotations, etc... but when you're inside a string for instance: "<inside here>" and you start typing a single quote or if the quotes are inverted it'll try to auto pair quotations inside the string. Is there a way to disable this functionality inside strings?

like image 460
exts Avatar asked Sep 19 '17 12:09

exts


People also ask

How do you handle single quotation marks?

Single quotation marks are used to indicate quotations inside of other quotations. “Jessie said, 'Goodbye,'” Ben said. This is Ben talking, so his words go in quotation marks. But because we're quoting Ben quoting someone else, Jessie, we use single quotation marks to indicate the quote within the quote.

How do you escape quotation marks in a string?

' You can put a backslash character followed by a quote ( \" or \' ). This is called an escape sequence and Python will remove the backslash, and put just the quote in the string.

Can string be enclosed in single quotes?

Single & Double Quotes Enclose strings. Either single or double quotes are fine. Use single quotes as enclosing quotes to eliminate the need of escaping double quotes in a string, and vice versa.


2 Answers

// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,

In your settings.json file will disable auto-closing brackets, parentheses, quotes, etc.

There is no separate switch for selectively disabling quotation matching, only a global setting for all.

like image 115
ifconfig Avatar answered Nov 15 '22 08:11

ifconfig


There is a setting to disable auto-closing of all quotes in the latest version of VSCode as of August 2018 in VSCode 1.27. Add this to your settings.json:

"editor.autoClosingQuotes": "never"

If you want to disable this for a specific language, nest the above setting under a language-specific setting. For example, to exclusively disable this for the scheme language,

"[scheme]": {
  "editor.autoClosingQuotes": "never",
},

Unfortunately, I do not think there is an option to exclusively disable auto-closing of single quotes or double quotes.

like image 34
qiu Avatar answered Nov 15 '22 06:11

qiu