Action Directory / Prepend dashes

Install

Prepends each line of the selected text by a dash and a space.

Shared by georgec

Script

const text = editor.getSelectedText();
var lines = text.split("\n");
lines = lines.map(function(l) { 
    return '- '+l;
});
editor.replaceSelection(lines.join("\n"));