GROWI のエディタは CodeMirror 6 をベースに、4 つのキーマップモード(default, vscode, vim, emacs)をサポートしている。本仕様では以下の 2 つの目的を達成する:
C-c C-s プレフィックス)を拡張し、本家 jrblevin/markdown-mode を参考にした網羅的な Markdown 操作バインディングを提供するpackages/editor/src/client/services-internal/keymaps/ に vim.ts, emacs.ts が存在し、index.ts がディスパッチャtoggleMarkdownSymbol が emacs.ts 内にローカル実装されており、既存の generateAddMarkdownSymbolCommand / useInsertMarkdownElements と責務が重複use-editor-shortcuts.ts が emacs モード判定のための条件分岐を持ち、各キーマップの差異を外部から管理している本家 Emacs markdown-mode の主要キーバインド(実装対象の参照用):
Text Styling (C-c C-s)
| Key | Command |
|-----|---------|
| C-c C-s i | Italic |
| C-c C-s b | Bold |
| C-c C-s c | Inline code |
| C-c C-s k | <kbd> tag |
| C-c C-s q / C-c C-s Q | Blockquote (word / region) |
| C-c C-s p / C-c C-s P | Preformatted code block (word / region) |
| C-c C-s C | GFM fenced code block |
| C-c C-s s | Strikethrough (GROWI extension, not in original) |
Headings (C-c C-s)
| Key | Command |
|-----|---------|
| C-c C-s h / C-c C-s H | Auto heading (atx / setext) |
| C-c C-s 1 ~ C-c C-s 6 | ATX heading level 1-6 |
| C-c C-s ! | Setext heading level 1 |
| C-c C-s @ | Setext heading level 2 |
Links & Images (C-c C-)
| Key | Command |
|-----|---------|
| C-c C-l | Insert/edit link |
| C-c C-i | Insert/edit image |
Horizontal Rule & Footnotes (C-c C-s)
| Key | Command |
|-----|---------|
| C-c C-s - | Horizontal rule |
| C-c C-s f | Footnote |
| C-c C-s w | Wiki link |
| C-c C-s t | Table |
Promotion & Demotion
| Key | Command |
|-----|---------|
| C-c C-- / C-c LEFT | Promote (outdent) |
| C-c C-= / C-c RIGHT | Demote (indent) |
List Editing
| Key | Command |
|-----|---------|
| M-RET / C-c C-j | New list item |
| C-c UP/DOWN | Move list item up/down |
Outline Navigation
| Key | Command |
|-----|---------|
| C-c C-n / C-c C-p | Next/previous heading (any level) |
| C-c C-f / C-c C-b | Next/previous heading (same level) |
| C-c C-u | Up to parent heading |
Other
| Key | Command |
|-----|---------|
| C-c C-k | Kill element at point |
| C-c C-o | Open link at point |
| C-c C-x C-s / C-x C-s | Save |
Objective: As a developer, I want each keymap mode to have a consistent module structure, so that adding or modifying keymaps follows a predictable pattern and reduces coupling.
keymaps/ directory.() => Promise<Extension>).Objective: As a developer, I want markdown symbol toggling logic to be shared across keymap modules and editor shortcuts, so that formatting behavior is consistent and not duplicated.
Objective: As a developer, I want each keymap module to declare which standard shortcuts it overrides, so that the shortcut registration layer can exclude conflicts without hard-coded mode checks.
Objective: As an Emacs user, I want C-c C-s prefix keybindings for markdown formatting, so that I can use familiar Emacs markdown-mode conventions in the GROWI editor.
C-c C-s b or C-c C-s B, the Editor shall toggle bold formatting (**) around the selection or at the cursor.C-c C-s i or C-c C-s I, the Editor shall toggle italic formatting (*) around the selection or at the cursor.C-c C-s c, the Editor shall toggle inline code formatting (`) around the selection or at the cursor.C-c C-s s, the Editor shall toggle strikethrough formatting (~~) around the selection or at the cursor.C-c C-s p, the Editor shall toggle code block formatting (`) around the selection or at the cursor.Objective: As an Emacs user, I want C-c prefix keybindings for structural markdown operations (lists, blockquotes, links, headings), so that I can perform all common markdown editing without leaving Emacs-style key sequences.
C-c C-s q, the Editor shall insert or toggle a blockquote prefix (>) on the current line, consistent with markdown-mode markdown-insert-blockquote.C-c C-l, the Editor shall insert a markdown link template ([]()) around the selection or at the cursor, consistent with markdown-mode markdown-insert-link.C-c C-s -, the Editor shall insert a horizontal rule (---) at the current line, consistent with markdown-mode markdown-insert-hr.C-c C-s h, the Editor shall insert an ATX heading with auto-determined level based on context, consistent with markdown-mode markdown-insert-header-dwim.C-c C-s 1 through C-c C-s 6, the Editor shall insert or replace the corresponding heading level (# through ######) at the beginning of the current line.C-c C-j, the Editor shall insert a new list item appropriate to the current list context (bullet or numbered).C-c C-s C, the Editor shall insert a GFM-style fenced code block with language specifier prompt.Objective: As an Emacs user, I want C-x C-s to save the page, so that the standard Emacs save keybinding works in the GROWI editor.
C-x C-s, the Editor shall invoke the save action (same as the existing onSave callback used by Vim's :w).C-x C-s without error.Objective: As a developer, I want the Vim keymap module to follow the same structural pattern as other keymap modules, so that the codebase is consistent.
Vim.map calls) within the factory function rather than at module scope.Objective: As a user, I want the keymap selector UI to accurately represent all available keymap modes, so that I can choose my preferred editing style.
Objective: As an Emacs power user, I want additional markdown-mode keybindings for navigation, promotion/demotion, and advanced editing, so that the GROWI editor feels as close to native Emacs markdown-mode as possible.
C-c C--, the Editor shall promote (outdent) the current element (heading level decrease or list outdent).C-c C-=, the Editor shall demote (indent) the current element (heading level increase or list indent).C-c C-n / C-c C-p, the Editor shall navigate to the next/previous heading.C-c C-f / C-c C-b, the Editor shall navigate to the next/previous heading at the same level.C-c C-u, the Editor shall navigate up to the parent heading.C-c C-k, the Editor shall kill (delete) the element at point and add text content to the clipboard.C-c C-i, the Editor shall insert a markdown image template (![]()).C-c C-s t, the Editor shall insert a markdown table template.C-c C-s f, the Editor shall insert a footnote marker and definition pair.