返回资讯中心
外部精选
软件工程
#开发者实时流

Nook: A terminal Markdown editor where the cursor never moves

Nook is a terminal markdown note editor written in Go with Bubble Tea. Notes live in a small local SQLite database, are organised in folders, and are written with a Focus Line: the line you are typing always stays in th…

Hacker News 最新simone20a2026/10/27 · 今天14 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Nook is a terminal markdown note editor written in Go with Bubble Tea. Notes live in a small local SQLite database, are organised in folders, and are written with a Focus Line: the line you are typing always stays in the middle of the screen as raw markdown, while the rest of the document scrolls around it already rendered (headings, bold, links, quotes, lists and checkboxes without their markers).

Write without distractions. The cursor doesn't move: the text does. Your eye always stays on the same spot.

Real markdown, nicely seen. Only the focused line shows raw text; the others are rendered with coloured styles and a fixed, muted palette.

A menu for your notes. A list centred on the selected entry, nested folders, a trash with restore, title filter, rename and on-the-fly creation.

Keyboard and mouse. Every action has a shortcut; click, double click, triple click and drag work as you would expect.

Nothing fragile. Notes are stored in SQLite and deletion is soft: a trashed note can be recovered until you delete it forever.

Installation

Requires Go 1.26 or later.

git clone <repository-url> nook cd nook go build -o nook .

With the Makefile: make build, make run, make test, make vet, make fmt.

./nook

On start-up the note list opens; from there you create, open, rename and trash notes. Storage is SQLite at ~/.nook/notes.db (override with NOOK_DB), with soft deletion: trashed notes remain recoverable from the trash.

The interface has margins of 2 columns and 1 row on every side (reset below 30 columns or 10 rows) and a footer with the main keys; each screen has its own help popup with the full key map.

Entries sit in a card at most 60 columns wide, centred horizontally and vertically on the selected entry. Each entry takes two lines: the name and, below it, a detail (date · N words for notes, N notes or empty for folders). Each entry is separated from the next by a ─ line. The title at the top is NOTES, with the folder path when you go down (NOTES › projects), or TRASH in the trash view.

Folders sit at the top of the list (name with a / suffix, own colour) and can be nested. Notes are created in the folder you are currently in. Trashing a folder sends its subfolders and all the notes it contains to the trash too; a note restored from a trashed folder returns to the root.

In input popups (n, r, f) enter confirms and esc cancels. In confirmation popups (d, x) y or enter confirm, n or esc cancel.

Mouse: a click selects the entry, a double click opens the note or enters the folder.

The Focus Line always stays on the middle row: as you move, the text scrolls, not the cursor. The Focus Line shows raw markdown; every other line is rendered, with markers hidden (#, **, ) and coloured styles for bold, italic, code, links, strikethrough, quotes, lists and checkboxes. Quotes (> text) are italic and flanked by a vertical bar ▌ running along the whole block, consecutive lines included — even the Focus Line, which shows the raw > but keeps the bar. Lines that are not in focus use a muted palette that is fixed and identical for all of them: the dimming does not depend on the distance from the Focus Line. Long lines are truncated with ….

In the Save / Discard / Cancel popup: ←/→ choose, enter confirms, esc returns to the editor.

The selection is visible: selected text is highlighted both on the (raw) Focus Line and on rendered lines, where the highlight is mapped onto the markdown segments. Typing or deleting replaces the selected text; formatting actions wrap it.

Mouse: a click makes the clicked line the Focus Line (the column is mapped onto the raw text through the markdown segments), a double click selects the word, a triple click the line; holding the left button and dragging extends the selection. With the mouse enabled, native terminal selection is done by holding Shift (or from the terminal's menu).

F3 opens the formatting palette: ↑/↓ to scroll through the actions, enter to apply, esc to close without applying.

Alternatively, ctrl+t followed by a letter:

If another key arrives after ctrl+t, the wait is cancelled and the key does its usual job. With an active selection the action wraps the selected text; with no selection on the Focus Line you can also type markdown by hand, since the text there is raw.

F1 or ctrl+/ opens the help popup on any screen; ? also works from the list (where you are not typing text). The popup is organised in tabs — List, Editor, Formatting, Mouse and General — and opens on the one that matches the current screen. Use ←/→ (or tab, or 1–5) to switch tab, ↑/↓ to scroll, and esc, q or F1 to close it.

With NOOK_DEBUG_KEYS=1 every tea.KeyMsg received is appended to ~/.nook/keys.log (one line per key, with Type, Runes, Alt, Paste and String), useful to see what your terminal actually sends. Messages the application doesn't recognise are logged as well — for example unknown escape sequences (CSI), which bubbletea delivers as generic messages — in the format:

Type=%T Val=%q

that is, the Go type of the message and its quoted value (one line per message). Messages that are already handled (WindowSizeMsg, KeyMsg, MouseMsg and the ticks that dismiss toasts) don't end up in this log: keys stay recorded in the logKey line. Without that variable (or with a value other than 1) nothing is written and the file is not created.

NOOK_DEBUG_KEYS=1 ./nook

How it was built

Nook was created exclusively with the coding agent Orcrist, using only the DeepSeek Flash and DeepSeek Pro models: no other agent or model wrote the code.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →