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

planmode

A read-only mode. The model investigates and writes a plan, then you accept it, keep planning, or leave.

require("planmode").setup({ allow = { "npm test" } })
OptionMeaningDefault
allowCommand prefixes that run without asking while planning.none
confirmfalse skips the accept picker at the end of a turn.true
badgefalse leaves planmode.Badge off the screen, for a bar that shows it itself.true
keysfalse leaves Ctrl+B unbound.true
priorityThe priority of its before_tool hook.10

Commands are /plan and /plan <task>. Ctrl+B toggles plan mode.

planmode.Badge() is a view that says plan while plan mode is on. planmode declares it as a bottom_bar item, and a statusline bar can show it instead:

local ito = require("ito")
local statusline = require("statusline")

require("planmode").setup({ badge = false })

uji.ui.toolbar({
  ito.ToolbarItem(ito.ToolbarPlacement.bottom_bar, function()
    return statusline.Bar({ require("planmode").Badge(), statusline.Cwd(), ito.Spacer(), statusline.Context() })
  end),
})