Skip to content

Instantly share code, notes, and snippets.

@wolframkriesing
Created September 9, 2011 08:45
Show Gist options
  • Save wolframkriesing/1205782 to your computer and use it in GitHub Desktop.
Save wolframkriesing/1205782 to your computer and use it in GitHub Desktop.
Komodo macro: replace a selected string 's' with 'JSON.stringify("s")'
// This is a macro for the IDE Komodo http://www.activestate.com/komodo-edit
var s = ko.views.manager.currentView.scimoz;
// If nothing was selected use {} ... dont know if useful, but we will see.
s.replaceSel("JSON.stringify("+ (s.selText || "{}") +")");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment