← All posts

Typing from the keyboard: shortcuts, snippets, autocorrect

Translated automatically from RussianRead the original →

Drafta hotkeys, quick navigation with ⌘P, slash snippets, and auto-replacements while typing — everything that keeps you from reaching for the mouse.

I write notes between two tasks in a code editor, so Drafta needs to respond to the keyboard as fast as an IDE. This article covers shortcuts, quick switcher, snippets, and text substitutions. How the library itself is structured is covered in the article Notes are files: notebooks, tags, statuses, and links.

Quick switcher with ⌘P

⌘P opens the quick switcher panel. It’s a fuzzy search across all notes: a few letters from the title are enough. The panel has four prefixes that narrow the search:

PrefixWhat it searches
>app commands
b notebooks
t tags
#headings within the open note

Letter prefixes need a space after the letter, so the query book searches for a word, not notebooks.

Quick switcher panel over the window: search field, list of notes with notebooks and tags, prefix hints at the bottom

Quick switcher: notes with notebook, tags, and edit time, with hints for Commands, Notebooks, Tags, Outline at the bottom.

App shortcuts

ShortcutAction
⌘Nnew note in the current notebook
⇧⌘Nnew note from template
⌘Pquick switcher
⌘Fsearch in note
⌘JAI assistant
⌥⌘Lshow or hide the note list
⌥⌘Ball bookmarks
⇧⌘Eexport

Editor, preview, and split modes are switched with buttons — there is no separate shortcut for them.

Editor shortcuts

Formatting commands work inside the note text:

ShortcutAction
⌘Bbold
⌘Iitalic
⇧⌘Sstrikethrough
⇧⌘Mhighlight
⌘Einline code
⌘Klink
⇧⌘Kwiki link
⌘1, ⌘2, ⌘3heading level one, two, three
⇧⌘Lbulleted list
⇧⌘Onumbered list
⇧⌘Xtask
⇧⌘.quote
⇧⌘Bbookmark on line
⌥↑, ⌥↓move line up or down

In a table, Tab and ⇧Tab move between cells. Enter in a task list continues the list with a new task.

A custom shortcut for any command

Editor shortcuts are reassigned in the Keybindings section of the settings. The Record button records a new shortcut, the arrow next to it restores a single default value, and Reset All to Defaults restores all at once. Footnotes, formulas, diagrams, and images have no default shortcuts — you can assign them yourself.

Keybindings section: commands Bold, Italic, Strikethrough, Highlight, and others with shortcuts and Record buttons

Keybindings: each command has its own shortcut, a Record button, and reset.

Snippets via slash

A slash in the editor opens the snippet list. Drafta has 14 built-in ones:

  • /img, /link, /table, /code — image, link, table, code block;
  • /h1, /h2, /h3, /quote, /task, /hr — headings, quote, task, horizontal rule;
  • /date, /time, /datetime, /today — current date and time.

In the snippet body, the variables {{cursor}} work — where the cursor will land, {{date}} and {{time}}. Built-in snippets can be edited, the Add button adds your own, and Restore defaults returns the original set.

Snippets section: list of snippets /img, /link, /table, /code, /date, /time, /datetime, /today with their bodies

Snippets: each snippet has a trigger, a name, and a body with variables.

Text substitutions while typing

The Text Substitutions section collects replacements that trigger right as you type:

  • two hyphens turn into an em dash;
  • a double space inserts a period;
  • brackets and quotes close automatically;
  • an expression like 2+2= is replaced with the result;
  • typographic quotes;
  • tag autocomplete after a hash.

Each substitution can be turned off individually if it gets in the way.

Text Substitutions section: six toggles — dash, period on double space, bracket autoclose, expression evaluation, typographic quotes, tag autocomplete

Text Substitutions: six replacements, each turned off with its own toggle.

One shortcut from the table deserves its own article — ⌘J opens the AI assistant. But first, about how Drafta stores edit history.