Skip to content

Instantly share code, notes, and snippets.

@soneyworld
Forked from anonymous/sortSelectedText
Created December 28, 2012 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soneyworld/4398621 to your computer and use it in GitHub Desktop.
Save soneyworld/4398621 to your computer and use it in GitHub Desktop.
%SCRIPT
var text = cursor.selectedText();
var array = text.split("\n");
array.sort();
text = "";
for (var line in array){
text += array[line];
if(line < array.length -1){
text+="\n";
}
}
cursor.replaceSelectedText(text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment