Sort CI
Sort ignoring case

Script key: Sort ignoring case

Posted by @corwinslack

Install

Details

Label Sort CI
Voice Over Sort ignoring case
Script
// Script keys run short Javascripts
// For documentation and examples, visit:
// http://help.agiletortoise.com
// from StackOverflow inspired by
// Ivan Krechetov implemented by CRSlack

// Alpha sort selected lines ignores case.

var lnRange = getSelectedLineRange();
var ln = getTextInRange(lnRange[0],lnRange[1]);

var lines = ln.split('\n').sort(function (a, b) {
    return a.toLowerCase().localeCompare(b.toLowerCase());
});
setTextInRange(lnRange[0],lnRange[1],lines.join('\n'));

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus