Skip to content

Instantly share code, notes, and snippets.

@craigkeeling
Created May 6, 2014 18:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigkeeling/108e49042a61f46e5c15 to your computer and use it in GitHub Desktop.
Save craigkeeling/108e49042a61f46e5c15 to your computer and use it in GitHub Desktop.
Find/replace those curly ones
# 1. Make a folder under your Data/Packages folder, call it "Straight Quotes"
# 2. Create a file in there called "Straight Quotes.py" and paste in the following:
# 3. Create another file in there called "Main.sublime-menu" (see that filename)
# http://www.sublimetext.com/forum/viewtopic.php?f=3&t=14451
import sublime, sublime_plugin
class StraightQuotesCommand(sublime_plugin.TextCommand):
def run(self, edit):
for rgn in self.view.find_all("[“”]"):
self.view.replace(edit, rgn, "\"")
for rgn in self.view.find_all("[‘’]"):
self.view.replace(edit, rgn, "\'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment