Skip to main content
CodeInk uses CodeMirror 6 as its editor engine, giving you access to a rich set of keyboard shortcuts for efficient markdown editing.

Editor Shortcuts

Text Selection

Shortcut: Ctrl+A (Windows/Linux) or Cmd+A (Mac)Select all text in the editor.
Shortcut: Ctrl+L (Windows/Linux) or Cmd+L (Mac)Select the entire current line.
Shortcut: Shift+Arrow KeysExpand selection character by character or line by line.
Shortcut: Ctrl+Shift+Left/Right (Windows/Linux) or Cmd+Shift+Left/Right (Mac)Select words at a time.

Copy, Cut, and Paste

Copy

Ctrl+C / Cmd+CCopy selected text

Cut

Ctrl+X / Cmd+XCut selected text

Paste

Ctrl+V / Cmd+VPaste from clipboard

Undo and Redo

ActionWindows/LinuxMac
UndoCtrl+ZCmd+Z
RedoCtrl+Y or Ctrl+Shift+ZCmd+Shift+Z
CodeInk maintains a full undo/redo history for each document. Changes are preserved even after auto-save.

Line Manipulation

Shortcut: Ctrl+Shift+K (Windows/Linux) or Cmd+Shift+K (Mac)Delete the entire current line.
Shortcut: Alt+UpMove the current line up by one position.
Shortcut: Alt+DownMove the current line down by one position.
Shortcut: Ctrl+Shift+D (Windows/Linux) or Cmd+Shift+D (Mac)Duplicate the current line or selection.

Indentation

ActionShortcut
IndentTab
OutdentShift+Tab
Indent MoreCtrl+] / Cmd+]
Indent LessCtrl+[ / Cmd+[
You can indent or outdent multiple lines by selecting them first, then pressing Tab or Shift+Tab.

Cursor Movement

Move by Character

Left/Right Arrow KeysMove cursor one character at a time

Move by Line

Up/Down Arrow KeysMove cursor one line at a time

Move by Word

Ctrl+Left/Right (Windows/Linux)Alt+Left/Right (Mac)Jump between words

Jump to Line Start/End

Home / EndJump to beginning or end of line

Document Navigation

ActionWindows/LinuxMac
Jump to Document StartCtrl+HomeCmd+Home or Cmd+Up
Jump to Document EndCtrl+EndCmd+End or Cmd+Down
Page UpPage UpPage Up
Page DownPage DownPage Down

Markdown-Specific Shortcuts

CodeMirror’s markdown mode includes smart behaviors for markdown editing:

Lists

Shortcut: Enter (at end of list item)Automatically continues lists with the appropriate marker:
- First item
- Second item [press Enter]
- [cursor here]
Shortcut: Enter twice (on empty list item)Press Enter twice on an empty list item to exit the list.
Shortcut: TabIndent a list item to create a nested list:
- Parent item
  - Child item [press Tab to indent]
Shortcut: Shift+TabOutdent a nested list item.

Code Blocks

Inside fenced code blocks (triple backticks), Tab inserts a real tab character instead of triggering indentation commands.

Search Shortcuts

CodeMirror includes built-in search functionality:
ActionWindows/LinuxMac
FindCtrl+FCmd+F
Find NextCtrl+G or F3Cmd+G
Find PreviousCtrl+Shift+G or Shift+F3Cmd+Shift+G
ReplaceCtrl+HCmd+Alt+F
The search panel appears at the top of the editor with options for case sensitivity and regex matching.

CodeInk-Specific Shortcuts

Status Bar Actions

Close Info Popup

EscapeClose the document info popup if open

Fix Lint Issues

Click “Fix” button in status barAutomatically fix common markdown linting issues

Lint Fix Implementation

The lint fix button in the status bar runs automated fixes:
fixBtn?.addEventListener("click", () => {
  const content = getEditorContent()
  const fixed = fixMarkdown(content)
  if (fixed !== content) setEditorContent(fixed)
})
Common fixes include:
  • Adding blank lines around headings
  • Fixing list indentation
  • Normalizing heading hierarchy
  • Standardizing list markers

Multi-Cursor Editing

CodeMirror supports advanced multi-cursor editing:
1

Add Cursor

Hold Alt (Windows/Linux) or Option (Mac) and click to add additional cursors
2

Edit Multiple Locations

Type to edit all cursor locations simultaneously
3

Remove Extra Cursors

Press Escape to return to a single cursor
Multi-cursor mode is powerful but can be disorienting. Use Escape to reset if you get lost!

Custom Keybindings

CodeInk uses CodeMirror’s default keybindings from the basicSetup extension:
import { basicSetup } from "codemirror"
import { markdown } from "@codemirror/lang-markdown"

const state = EditorState.create({
  doc: initialDoc,
  extensions: [
    basicSetup,
    markdown({
      addKeymap: true,  // Enable markdown-specific keybindings
    }),
    // ... other extensions
  ],
})

Comments

While markdown doesn’t have native comment syntax, you can use HTML comments:Type <!-- comment text --> directly in the editor. These won’t appear in the preview.

Platform Differences

Key Naming

Windows/LinuxMacDescription
CtrlCmdPrimary modifier key
AltOptionSecondary modifier key
WinCmdSystem key (rarely used)

Common Patterns

Windows/Linux Pattern

Most shortcuts use Ctrl as the primary modifier:
  • Ctrl+C: Copy
  • Ctrl+V: Paste
  • Ctrl+Z: Undo

Mac Pattern

Most shortcuts use Cmd as the primary modifier:
  • Cmd+C: Copy
  • Cmd+V: Paste
  • Cmd+Z: Undo

Editor Configuration

CodeInk’s editor setup includes these keyboard-friendly features:
import { EditorState } from "@codemirror/state"
import { EditorView } from "@codemirror/view"
import { basicSetup } from "codemirror"

const state = EditorState.create({
  extensions: [
    basicSetup,  // Includes: history, search, selection, keybindings
    markdown({ addKeymap: true }),
    // ... other extensions
  ],
})

What basicSetup Includes

  • Full undo/redo history
  • Search and replace
  • Multi-cursor support
  • Bracket matching
  • Auto-indentation
  • Line numbers
  • Default keybindings

Accessibility

CodeInk’s editor is keyboard-accessible:
  • Tab Navigation: Move focus between UI elements
  • Arrow Keys: Navigate within the editor
  • Screen Reader Support: CodeMirror includes ARIA labels
  • No Mouse Required: All features accessible via keyboard
The editor automatically captures keyboard focus when you navigate to the editor page.

Tips for Efficiency

Learn Word Navigation

Using Ctrl/Cmd+Arrow to jump between words is much faster than holding arrow keys.

Master Line Manipulation

Alt+Up/Down to move lines and Ctrl/Cmd+Shift+K to delete lines can save tons of time.

Use Multi-Cursor

For repetitive edits, multi-cursor mode (Alt/Option+Click) is incredibly powerful.

Leverage List Continuation

Let the editor auto-continue your lists by just pressing Enter at the end of list items.

Build docs developers (and LLMs) love