Ctrl-pでpublicicon
code:script.js
document.addEventListener('keydown', (e) => {
if (e.key === 'p' && e.ctrlKey && !e.shiftKey) {
e.preventDefault(); // デフォルトの動作を防ぐ
const selection = window.getSelection();
if (!selection.rangeCount) return;
const range = selection.getRangeAt(0);
range.deleteContents();
const textNode = document.createTextNode('public.icon');
range.insertNode(textNode);
// カーソルを挿入したテキストの後に移動
range.setStartAfter(textNode);
range.setEndAfter(textNode);
selection.removeAllRanges();
selection.addRange(range);
}
});