How to make this snippet?
I want to find all X and replace them for Y in a selected text only.
Thank you in advance
How to make this snippet?
I want to find all X and replace them for Y in a selected text only.
Thank you in advance
You canβt do this with a snippet, however itβs totally doable with a userscript:
var editor = require("ko/editor");
var selection = editor.getSelection();
replacement = selection.replace(/foo/g, "bar");
editor.replaceSelection(replacement);