The Curly Quote Conundrum
Google Docs attempts to make your documents look professionally typeset by default. One of the ways it achieves this is by implementing “Smart Quotes.” When you type standard, straight quotation marks (the default output of most computer keyboards, looking like vertical hash marks: " "), Docs automatically and instantly converts them into curly, directional quotation marks (often called typographer’s quotes: “ ”). While this looks excellent in a novel or an essay, it is absolutely disastrous if you are using Google Docs to write snippets of programming code, HTML, or command-line scripts, as software compilers cannot read curly quotes and will instantly throw syntax errors.
Reverting to Straight Quotes
To protect the integrity of your code snippets and stop Google Docs from automatically changing your straight quotation marks into curly smart quotes, you must disable the specific auto-formatting rule.
Open your Google Doc. Look at the primary menu bar across the top of the window and click on Tools. From the resulting dropdown menu, select Preferences. A settings dialogue box will appear in the center of your screen. Click on the General tab at the top of this box if it is not already selected. Look down the list of checkbox options for the one explicitly labelled Use smart quotes. Click this checkbox to completely uncheck it. Finally, click the blue OK button to save the change. From now on, whenever you type a quotation mark, it will remain perfectly straight and code-compliant.