Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Blocks

Most of n0te’s keys act on blocks, and editing happens a block at a time. This page explains what a block is and how editing one stays exact.

What’s a block

When n0te renders a note, it cuts it into blocks:

  • each paragraph, heading, code block, table, rule and footnote;
  • each list item, nested ones too, so j stops on every task in a checklist;
  • each quote or callout, as one block with everything inside it.

A list item and its sub-items form a subtree. o adds a new item after the whole subtree, alt ↑ and alt ↓ move the item with its subtree, and tab nests it along with its subtree.

Every block knows its source

For every block, n0te records exactly which bytes of the file it came from, the way the file is on disk, %%comments%% included. That’s what makes block editing safe:

  • e swaps the block’s rendered text for those bytes, in an edit box. Only the box is editable; the rest of the page is locked.
  • While you type, only that block is parsed and restyled, so a long note stays fast.
  • On save, the edited text is spliced into the file in place of those bytes. Every other byte of the file stays as it was. Blank lines at the edges of your edit are tidied, so a block can’t swallow its neighbours’ spacing.
  • A tick changes the one status character between [ and ], and the page updates where it is, without re-rendering.

n0te --check tests this on your whole vault: it renders every note, checks that each block maps back to its source, and that putting an unchanged block back reproduces the file byte for byte. It also lists any markdown left on the page as literal text. On the maintainer’s vault, both counts are 0.

Edits of more than one block

  • V then e edits a run of blocks as one piece of source.
  • ctrl e edits the whole note as source, for changes that cut across blocks. n0te restyles it 200 ms after you stop typing.
  • Code files are one block: e edits the whole file.

The page doesn’t jump

When a block changes, n0te re-renders the note, but it doesn’t redraw the page. It keeps the parts of the page that are the same before and after, replaces only the middle, and holds the block you were on in place while GTK lays out the new text. So esc after an edit, deep in a long note, leaves you where you were.