Add markdown formatting hotkeys to the editor
Ctrl/Cmd+B/I/E wrap the selection in bold / italic / inline-code markers, Ctrl/Cmd+Shift+X in strikethrough, and Ctrl/Cmd+K as a link (with the url placeholder selected). Pressing the same key on already-wrapped text removes the markers. Applied to the live selection via the TextEdit cursor range, with the caret/selection restored around the edit. Documented in the built-in cheatsheet and the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+18
@@ -54,6 +54,24 @@ fn cheatsheet_body(ui: &mut egui::Ui) {
|
||||
],
|
||||
);
|
||||
|
||||
section(ui, "Formatting hotkeys");
|
||||
syntax(
|
||||
ui,
|
||||
"cs-keys",
|
||||
&[
|
||||
("Ctrl/Cmd + B", "Bold the selection (**…**)."),
|
||||
("Ctrl/Cmd + I", "Italicise the selection (*…*)."),
|
||||
("Ctrl/Cmd + E", "Inline code (`…`)."),
|
||||
("Ctrl/Cmd + Shift + X", "Strikethrough (~~…~~)."),
|
||||
("Ctrl/Cmd + K", "Wrap as a link and select the url to replace."),
|
||||
],
|
||||
);
|
||||
note(
|
||||
ui,
|
||||
"Applied to the selected text (or the caret, for an empty selection). \
|
||||
Pressing the same key on already-wrapped text removes the markers.",
|
||||
);
|
||||
|
||||
section(ui, "Paragraphs & breaks");
|
||||
syntax(
|
||||
ui,
|
||||
|
||||
Reference in New Issue
Block a user