How do I turn off the red and green lines that appear under grammar and spelling errors?
Define a new style for the code - set the appropriate font and line spacing, etc. and disable spell checking for the style. Apply this style to all of your code examples.
The fastest way is to simply right-click on the word and select Ignore (One or All). You can also go to Options in Spell Check Mode and turn it off