← Blog

Typing from the keyboard: shortcuts, snippets, autocorrect

Translated automatically from Russian. Read the original →

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 switch, snippets, and text substitutions. How the library itself is structured is covered in the article Заметки — это файлы: блокноты, теги, статусы и связи.

Quick switch with ⌘P

⌘P opens the quick switch 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 inside the open note

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

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

Quick switch: 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 a template
⌘Pquick switch
⌘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 of them 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 substitutions that trigger right as you type:

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

Each substitution can be turned off separately 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 substitutions, 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.

← All posts