Beancount Quick EditSmall, focused editing improvements for Beancount files. Keep long transaction narrations and open-directive commodity lists compact, change the year, month, or day in an ISO date without leaving the keyboard, and copy a complete account name without changing normal word selection. FeaturesKeep long Beancount lines compactLong transaction narrations are visually shortened to keep the transaction header within an approximately 120-column display budget. The date, flag, payee, closing quote, tags, links, and comments remain visible:
Long commodity lists in valid
The hidden text remains unchanged in the document. Saving, search operations, copying, Beancount parsing, language services, and other extensions receive the original text. The active search result reveals its line; inactive match highlights can remain compact. Copying a visually shortened line therefore copies its complete source text. Move a cursor or selection onto a compact line to reveal its complete contents. It collapses again after every cursor and selection leaves that line. Selection changes from VSCodeVim and multiple cursors use the same reveal rule without changing Vim state. Compact previews are enabled by default. They can be disabled, or their approximate total-line limit can be changed, in the Settings editor under Beancount Quick Edit › Compact Preview:
The limit is measured in approximate display columns because fonts, emoji, and editor layout can
vary. Only the narration or commodity-list tail is shortened; unusually long payees, accounts,
booking methods, tags, or comments can still exceed the configured limit. Preview matching is
limited to single-line directives that begin with a conventional Compact previews remain active with word wrap both on and off, so users can switch freely. VS Code calculates wrapped rows from the complete underlying text before decoration ranges are visually hidden. Consequently, an unusually long narration or commodity list can leave blank continuation rows when word wrap is enabled. This is a display-only artifact; document contents are unchanged. Turn word wrap off only if you prefer the densest layout. Compact previews stay off in diff, merge, custom, embedded, and explicit screen-reader editor views so those views retain their native geometry and accessibility. Adjust dates at the cursorPlace the caret anywhere from the beginning of a valid
The caret is an insertion point between characters. The position immediately after
Date arithmetic follows the proleptic Gregorian calendar:
Changing a day rolls across months and years. Changing a month or year keeps the day when possible and otherwise clamps it to the final day of the destination month. Supported years are Outside a valid date, VS Code keeps its normal VSCodeVim:
|
| Vim Normal mode | Date action |
|---|---|
Ctrl+A |
Increase the year, month, or day at the caret |
Ctrl+X |
Decrease the year, month, or day at the caret |
A numeric prefix changes the selected component by that many calendar units in one edit:
3 Ctrl+A on the day 2026-01-30 → 2026-02-02
2 Ctrl+A on the month 2024-01-31 → 2024-03-31
4 Ctrl+A on the year 2024-02-29 → 2028-02-29
2 Ctrl+X on the day 2024-03-01 → 2024-02-28
On macOS these use the Control key, not Command. To enable them:
- Open the Command Palette.
- Run Beancount Quick Edit: Set Up VSCodeVim Ctrl+A/X Shortcuts.
- The command copies two keybinding entries and opens
keybindings.json. Paste them before the final]. If the file already contains entries, add a comma after the existing final entry first.
If you used the setup command in version 0.2.0, run it again and replace those two entries. Version 0.3.0 removes asynchronous date and mode conditions from the copied bindings so rapid cursor or mode changes cannot intermittently fall through to a different handler.
This one-time setup is necessary because VS Code gives user keybindings reliable priority over
VSCodeVim's defaults; one extension's default keybindings cannot reliably override another's.
The setup command does not edit the file for you. The copied bindings use VSCodeVim's own
vim.remap command, so pending keys are processed in the same queue as VSCodeVim's native actions.
At execution time, Beancount Quick Edit handles the key only in VSCodeVim Normal mode when every caret is on a valid date in a writable Beancount editor. A plain key changes one calendar unit; a pure numeric prefix changes that many days, months, or years directly and is consumed exactly once. Insert and Visual modes, non-date positions, other languages, read-only editors, and pending Vim operators or macros retain VSCodeVim's native behavior.
The compatibility path is tested with VSCodeVim 1.32.4 and fails closed to native VSCodeVim handling if the inspected pending-command state is not recognized.
Copy the complete account at the cursor
Normal double-click word selection remains unchanged. Place the caret anywhere inside an account such as Assets:Bank:Checking, then press:
| Platform | Copy account |
|---|---|
| macOS | Option+Command+C |
| Windows / Linux | Ctrl+Alt+C |
The command copies and selects the complete account. It follows Beancount's account-name shape, including hyphens, digits after a colon, and uppercase Unicode letters.
Some international Windows and Linux keyboard layouts use Ctrl+Alt as AltGr. If that applies to your layout, reassign this command in VS Code's Keyboard Shortcuts editor.
Multiple cursors
Date adjustment and account-copy commands support multiple cursors:
- Date changes are applied in one edit and one undo step.
- Account names are copied in document order, one per line.
- Duplicate cursors on the same date or account are handled once.
- Date shortcuts activate when every cursor is on a valid date; otherwise VS Code keeps its normal key behavior.
- Account copying requires every cursor to be inside a valid account, or nothing is copied.
- Two cursors on different parts of the same date are treated as a conflict, so the command leaves every date unchanged.
Scope and compatibility
The extension activates only for the beancount language ID and works alongside Beancount syntax-highlighting and language-server extensions.
Matching is intentionally lexical and local to the current or visible lines. Compact previews
recognize transaction headers, quoted narration strings, and valid open commodity lists; date and
account commands still operate on date- or account-shaped text under the caret, including inside a
comment or string. The extension does not parse the complete ledger or read other files.
Privacy and security
Beancount Quick Edit:
- has no runtime dependencies;
- makes no network requests;
- contains no telemetry;
- does not launch processes or shell commands;
- does not read or write ledger or workspace files directly;
- changes long-line display with editor decorations without changing document text; and
- accesses only visible Beancount editors, the installed VSCodeVim module for pending-command compatibility, and the clipboard when you explicitly copy an account or set up Vim shortcuts.
VSCodeVim does not publish its pending-command state through VS Code's public extension API. After VS Code activates the already-installed VSCodeVim extension, the optional adapter reuses that same local module and inspects its in-process command state. When it recognizes only a numeric prefix, it consumes that prefix by replacing VSCodeVim's pending-command record with a freshly constructed default record before editing the date. It does not download or launch any external program, and it does not execute workspace-provided code. If that internal shape changes, the shortcut delegates to VSCodeVim instead of editing the date.
It supports untrusted and virtual workspaces in desktop VS Code because its behavior does not depend on workspace code or workspace filesystem access. The extension does not include a browser entry for vscode.dev. The shipped JavaScript is bundled but not minified, and includes a source map with embedded source content for inspection.
Commands
Open the Command Palette and search for Beancount Quick Edit:
Beancount Quick Edit: Increment Date PartBeancount Quick Edit: Decrement Date PartBeancount Quick Edit: Copy Account at CursorBeancount Quick Edit: Set Up VSCodeVim Ctrl+A/X Shortcuts
All shortcuts can be reassigned through VS Code's Keyboard Shortcuts editor.
Installation
In VS Code's Extensions view, search for Beancount Quick Edit and choose Install. To install a manually downloaded build, run Extensions: Install from VSIX... from the Command Palette and select the .vsix file.
Development
Requirements: Node.js 20 or newer, npm 11.17.0 or newer, and a current VS Code installation.
npm ci --strict-allow-scripts
npm run check
npm test
npm run test:integration
npm run package
npm run package creates beancount-quick-edit-0.4.0.vsix. See CONTRIBUTING.md for the release workflow.