thcThought Control

Keys you'll use

The handful of keys that do most of the work, the one key that finds the rest, and how to remap any of them.

You don’t need to learn many. There are two places you can be, and one key in each that shows you everything else:

  • Writing (a journal day or a page): F1.
  • Everywhere else (Today, Inbox, Tasks, Search, Log): Space, which opens a panel of every command, grouped. Or ? for help.

The footer always shows the few keys that work right now, and they’re your keys: remap one and the footer, help and the palette all change with it. Every key, by where it works, is in the keys reference, generated from the same table thc runs on, so it can’t drift.

While writing

⌃TText → task → done → text
EnterNew line. Twice: a new note
⇧Enter or ⌃JA line break inside the same item
Tab / ⇧TabIndent / outdent
⌥↑ / ⌥↓Move a line, with its children
⇧ + arrowsSelect
⌘C / ⌘X (or ⌃C / ⌃X)Copy / cut, as Markdown
⌘A (or ⌥A)Select all
⌘V / ⌃VPaste, screenshots too. ⌥V makes the next paste plain
⌘Z / ⇧⌘Z (or ⌃Z / ⌃Y)Undo / redo
[[Link a page
⌃OOpen the link under the cursor, or go to any page or day
⌃P / ⌃NThe day before / after
⌥ZFocus
EscSave and go up: to the list or day where you started, else Today
⌘[ / ⌘] (or ⌃⌥← / ⌃⌥→)Back and forward through the places you’ve been, like a browser. :history (or space g h) lists them
⌃QQuit. It’s all saved already

Moving around works the way a Mac text field does: ⌘← ⌘→ to the line’s start and end, ⌘↑ ⌘↓ to the top and bottom of the page, ⌥← ⌥→ by word, add ⇧ to select. ⌘⌫ deletes to the start of the line, ⌥⌫ a word. Readline keys work too (⌃A ⌃E ⌃W ⌃K ⌃U), and so do Home, End, PgUp and PgDn. The arrows follow what’s on screen: through wrapped lines, keeping your column.

Your terminal has to send the ⌘ keys. kitty does. In WezTerm, run thc setup wezterm --yes once: the keys then act only while thc is running, and your shell and editors are untouched. After an update, thc refreshes its own key file the next time it runs (it never edits your wezterm.lua), so new ⌘ keys work without running setup again. Everywhere else, the ⌃ and ⌥ twins work. On a Mac, turn on “Option as Meta” in your terminal for the ⌥ keys; thc tells you if it’s off.

In lists

j / kMove (or the arrows)
EnterOpen it where it lives
x / XDone / reopen
d / sDue / scheduled date
p then h m lPriority
#Tags
mMove
a / AAdd here / to the inbox
DDelete (u brings it back)
uUndo
/Search
fFilter (Tasks)
1–7, TabViews
:Commands, by name
⌃OGo to a page or day
qBack, then quit

On Pages and Search, typing finds: letters go into the find box, the arrows move, and Enter opens. With the box empty, 1–7, ?, :, Space and q work as everywhere else. Esc clears the find, then goes back.

Tab always goes round the views. Arriving on a journal day or a page by Tab, the document waits: Tab keeps moving between views, and any other key, or a click in the text, starts writing. Nothing you type is lost.

The leader

Space in any list opens a panel that shows what can follow. Read it instead of remembering:

─ space ─────────────────────────────────────────────────────
 f  +find          t  +toggle        r  review lane    q  quit
 g  +go            v  +views         e  $EDITOR        ?  every key
 n  +new           space  commands   E  $EDITOR page

space g t goes to Today, space n p makes a page, space t f toggles Focus, space v 1 runs your first saved view. ⌫ steps back one key, Esc closes.

The mouse

Click to place the cursor, drag to select, click a [ ] to toggle it, click a date to change it, and click any tab, row or footer key. Hold ⇧ (⌥ in iTerm2 and Terminal.app) while dragging for your terminal’s own selection. More in The mouse.

Remapping

The easy way: thc keys --edit. It opens your config at a list of every key, commented out and grouped by where it works, each with what it does:

# ── Keys (thc keys --edit) ─────────────────────────────────────────
# Remap a key: uncomment a line and its [keys.…] line, and change the key on the left.
# "no_op" unbinds a key. Notation: C- ⌃  A- ⌥  S- ⇧  Cmd- ⌘

# [keys.global]
# "Cmd-[" = "nav.back"               # ⌘[       back
# "?" = "help.context"               # ?        keys

Uncomment a line, change the key, save, and thc checks it: keys ok · 1 remapped, or the problem and its line. Run it again any time: the list refreshes, and your changes stay. --context write opens at one table, and --print shows the block without opening an editor.

Three common moves:

[keys.global]
"q" = "no_op"            # unbind a key
"F9" = "focus.toggle"    # add a second key for an action

[keys.write]
"C-g" = "doc.open"       # give an action a different key

By hand, the same tables work anywhere in your config. Put [keys.<context>] tables in ~/.config/thought/config.toml: a key on the left, an action on the right. A key replaces what it did in that context; "no_op" unbinds it.

[keys.list]
"C-x" = "node.done"     # ⌃X completes, as well as x
"q" = "no_op"           # never quit with q

[keys.write]
"A-t" = "doc.task_cycle"

The action names are in the keys reference. Contexts: global, list, today, inbox, tasks, pages, journal, search, log, write. The pop-ups keep their own keys for now. A vault’s settings.toml can carry [keys.*] too, so a team shares a layout.

thc checks your remaps when it starts and says in the bar what it refused: an unknown action, a plain letter in write (it would stop you typing it), a key that starts a longer one, or Esc and ⌃C taken away.

$ thc keys              # the keymap in effect, your remaps included
$ thc keys --conflicts  # every problem a remap has
$ thc keys --json       # the table, for scripts