org.nvim

Clocking and effort

<prefix>xi      Clock in on the current entry. Any running clock is
                stopped first, and clock.in_switch_to_state can change the
                TODO state. A count picks a task from the clock history
                (d default task, i the interrupted task, c the current one,
                1-9 A-Z recent tasks); 16 also marks the entry as the
                default task; 64 starts where the last clock stopped.
<prefix>xo      Clock out (global). clock.out_switch_to_state changes the
                TODO state; with a count, you are asked for the state.
<prefix>xq      Cancel the running clock (global).
<prefix>xj      Jump to the clocked entry (global), else to the last
                clocked one. With a count, pick from the history.
<prefix>xe      Set effort.
<prefix>xE      Set effort to the next value of Effort_ALL.
<prefix>xm      Change the effort of the clocked task (or the entry at the
                cursor); +0:15 / -10 add or subtract.
<prefix>xz      Resolve open clocks (with a count: only dangling ones, not
                the running clock). See org-clock-resolve.
<prefix>xd      Show the time clocked in each subtree next to its headline,
                for clock.display_default_range (this year). Count: 4 =
                today, 16 = ask for a range, 64 = only the total. Editing
                the buffer, <C-c><C-c> or calling it again hides the sums.
                Like Emacs, a sum covers the tags and also shows on folded
                headlines; the times line up on the displayed title.
<prefix>xr      Insert a clock report (#+BEGIN: clocktable) for the entry
                at the cursor (:scope subtree), or the file before the
                first headline; update it when on one. With a count,
                update the first clock table of the buffer. A new block
                gets clock.clocktable_default_properties. The total
                and file time cells use clock.total_time_cell_format /
                clock.file_time_cell_format ("*%s*").
                clock.clocktable_formatter replaces the table writer:
                function(tables, params) gets `{ { file, time, entries
                = { { level, headline, tags, timestamp, time (minutes),
                properties } } } }` and the block parameters, and
                returns the lines of the block (org-clock-clocktable-formatter).
<C-c><C-c>      On a CLOCK line: recompute its duration.
<C-S-Up/Down>   On a CLOCK line: shift both timestamps by the part under
                the cursor, keeping the duration.
<M-K> / <M-J>   On a CLOCK timestamp (Emacs S-M-Up/Down): change it and
                move the touching timestamp of the previous (on a clock-in)
                or next (on a clock-out) task in the clock history by the
                same amount.
<S-arrows>      On a #+BEGIN: clocktable line: shift its :block
                (today -> today-1, 2026-W39 -> 2026-W40, ...).
:Org clock_in_last   Clock in the last clocked entry again (count: pick
                from the history; 16 = from the last clock-out; 64 = ask
                for the TODO state).
:Org clock_mark_default_task   Mark the entry as the default task.
:Org clock_toggle_auto_clockout  Turn auto clock-out on/off for this session.

Clock lines go into the LOGBOOK drawer:

:LOGBOOK:
CLOCK: [2026-09-23 Wed 10:00]--[2026-09-23 Wed 11:30] =>  1:30
:END:

The drawer comes from the inherited CLOCK_INTO_DRAWER property (nil for none, a number N for "once there are N clock lines"), then clock.into_drawer, then the log drawer. With log_note_clock_out (or #+STARTUP: lognoteclock-out), clocking out asks for a note that goes below the CLOCK line. clock.continuously starts a new clock where the last one stopped, clock.rounding_minutes rounds clock times and clock.in_resume continues an entry's open CLOCK line.

Marking a clocked task done clocks it out (clock.out_when_done: true or a list of states). A running clock is restored after restarting Neovim (clock.persist: true, "clock" or "history"), after asking (clock.persist_query_resume). Quitting with a running clock asks whether to clock out and save first (clock.ask_before_exiting). Clocks of 0:00 are kept unless clock.out_remove_zero_time is set.

The statusline shows [clocked/effort] (Task), where the clocked time includes the task's earlier clocks (clock.mode_line_total or the CLOCK_MODELINE_TOTAL property: current, today, repeat, all, auto = since LAST_REPEAT for repeated tasks). Once it reaches the Effort you are notified once (clock.notify_effort, clock.sound, clock.notification_handler) and clock.task_overrun_text is prepended.

User autocmds: OrgClockInPrepare (before the CLOCK line is written, e.g. to set an effort), OrgClockIn, OrgClockOut, OrgClockCancel, OrgClockGoto.

Resolving clocks
An open CLOCK line that isn't the running clock is dangling (e.g. after a
crash). Clocking in resolves them first (clock.auto_clock_resolution),
and after clock.idle_time idle minutes you are asked about the running
clock (the system idle time is used on macOS and with xprintidle). Keys:
  k / K   keep N of the minutes (default all) and stay clocked in / out
  t / T   keep the time until a given time
  g / G   you got back N minutes ago: clock out when you left, clock in
          again from then (G: stay out)
  s / S   subtract the idle time: clock in again now (S: stay out; the
          next clock in offers to start from the subtracted time)
  C       cancel the clock
  j / J   jump to the clock (J: clock it out first)
  i / q   ignore
clock.auto_clockout_timer clocks out after that many idle seconds.

Durations A duration is numbers with units, optionally ending in H:MM or H:MM:SS: 3:12, 1:23:45, 1y 3d 3h 4min, 1d3h5min, 3d 13:35, 2.35h; a bare number is minutes. The units and their minutes come from duration_units (Emacs org-duration-units):

duration_units = { min = 1, h = 60, d = 1440, w = 10080, m = 43200, y = 525960 }

Setting d = 480, w = 2400 makes 1d an 8-hour work day in efforts and column sums; new units can be added (wd = 480). Ages ({@min} ...) keep the standard min/h/d.

Durations in clock tables, clock sums, the clock mode line, effort changes
and column summaries are written with duration_format (Emacs
org-duration-format):
  "d h:mm"      1d 2:30 from one day on, else 2:30 (the default, Emacs
                (("d" . nil) (special . h:mm)))
  "h:mm"        26:30          "h:mm:ss"     26:30:00
  a list        of { unit, required } entries, { "special", mode } and
                "compact": units with a zero value are dropped unless
                required; mode "h:mm" / "h:mm:ss" writes the time below
                the smallest unit above an hour as H:MM(:SS); a number of
                decimals writes one unit with a fraction (the first
                required unit or one not larger than the duration);
                "compact" drops the spaces. Examples:
                { { "d" }, { "h", true }, { "min", true } } 1d 2h 30min
                { { "d" }, { "h" }, { "special", 2 } }       1.10d
                { { "h", true }, { "special", 2 } }          26.50h
                { { "w" }, { "special", "h:mm" }, "compact" }  1w32:00
                A dict form works too: { d = false, special = "h:mm" }.

Use org-api require("org").statusline() in your statusline.