diff --git a/src/editor/extensions.ts b/src/editor/extensions.ts index 5968a8a..4aca958 100644 --- a/src/editor/extensions.ts +++ b/src/editor/extensions.ts @@ -7,6 +7,7 @@ import { TextAlign } from "./align"; import { SearchHighlight } from "./search"; import { Proofing } from "./proofing"; import { Paste } from "./paste"; +import { Shortcuts } from "./shortcuts"; export const editorExtensions: Extensions = [ StarterKit.configure({ @@ -23,4 +24,5 @@ export const editorExtensions: Extensions = [ SearchHighlight, Proofing, Paste, + Shortcuts, ]; diff --git a/src/editor/shortcuts.ts b/src/editor/shortcuts.ts new file mode 100644 index 0000000..0774095 --- /dev/null +++ b/src/editor/shortcuts.ts @@ -0,0 +1,11 @@ +import { Extension } from "@tiptap/core"; + +export const Shortcuts = Extension.create({ + name: "shortcuts", + + addKeyboardShortcuts() { + return { + "Mod-Shift-x": () => this.editor.commands.toggleStrike(), + }; + }, +});