Properties and column view
| <prefix>p | Set a property. Names are completed, and values come from PROP_ALL properties when available. Before the first headline, the file-level property drawer at the top of the file is set (created after leading comments). |
| <C-c><C-x>P | Set a property from one PROPERTY: value answer (org-set-property-and-value); a count reuses the last one. |
| <prefix>P | Delete a property (and its PROPERTY+ lines). |
| <S-Right/Left> | (ctx) On a property line: next / previous allowed value from PROP_ALL (org-property-next-allowed-value). |
| <C-c><C-c> | (ctx) On a property line: menu to set the value, delete it here, delete it from all entries, or compute it with c (org-property-action). Also works in file-level drawers. |
:Org delete_property_globally removes a property from every entry of the buffer, including its file-level drawer; keyword defaults are retained. :Org compute_property_at_point uses the first matching summary operator in the nearest COLUMNS format. It updates existing values of that property within the format's scope; other properties are unchanged. With only a #+COLUMNS or default format, that scope is the current subtree (the whole file before the first heading). An inherited COLUMNS property selects the subtree or file drawer where it is defined.
| <prefix>xe | Set the Effort property (stored as typed, e.g. 1h). |
| <prefix>lI | Create an ID property (or show the existing one). |
Property lines are written with property_format (org-property-format, "%-10s %s"): :Owner: me; an empty value leaves :Owner:.
Setting the special properties TODO, PRIORITY, SCHEDULED or DEADLINE changes the headline instead (an empty value removes them), like Emacs org-entry-put; the other special properties cannot be set. Every change through <prefix>p fires the User autocmd OrgPropertyChanged with data { bufnr, lnum, name, value } (org-property-changed-functions).
Special properties available in matches and column view: ITEM, TODO, PRIORITY, TAGS, ALLTAGS, CATEGORY, FILE, SCHEDULED, DEADLINE, CLOSED, TIMESTAMP, TIMESTAMP_IA (first inactive timestamp), BLOCKED (t when the entry cannot be marked done, else empty). LEVEL works in matches only: like Emacs, a LEVEL column in column view stays empty.
Inheritance is controlled by use_property_inheritance (true, false, a list of property names, or a regexp matching them). NAME+ lines append to the value, also to an inherited one: :Acc: 1 on a parent and :Acc+: 2 on its child give 1 2. property_separators changes the separator per property (org-property-separators): { { { "A", "B" }, ", " }, { "^LIST", "|" } } joins A and B values with ", " and properties matching the regexp with "|". A property drawer at the top of the file, #+PROPERTY: NAME value and global_properties set values for the whole file, in that order. properties_postprocess maps property names (ignoring case) to functions function(value, target) that adjust values given to <prefix>p (org-properties-postprocess-alist).
:Org toggle_custom_properties_visibility hides the lines of the properties named in custom_properties in every property drawer of the buffer, and shows them again (org-toggle-custom-properties-visibility). Editing next to hidden ones asks whether to show them (org-hidden-lines). Needs Neovim 0.11.
| <prefix>C | Column view. The format comes from #+COLUMNS, the COLUMNS property or columns_default_format, for example %25ITEM %TODO %3PRIORITY %TAGS %Effort{:}. Summary operators (org-columns-summary-types-default): {+} (sum, printed like Emacs: 4.1, 6), {$} (2 decimals), {min} {max} {mean} (mean is always a float: 3.0), {:} {:min} {:max} {:mean} (durations, in duration_format unless all values are H:MM, or H:MM:SS: then H:MM:SS), {X} {X/} {X%} (checkboxes), {@min} {@max} {@mean} (ages of timestamps or durations in the standard min/h/d units), {est+} (low-high estimates). A format after ;, {+;%.1f}, is applied to every value of the column, leaves included. columns_summary_types adds operators: { ["+|"] = function(values, fmt) ... end } (or { summarize, collect } where collect(headline, prop) gives a headline's value). Like Emacs (org-columns-compute-all), opening column view and updating a columnview block write each computed summary into the entry's property when the entry already has that property (even empty) and its value differs. SCHEDULED, DEADLINE and TIMESTAMP show as inactive timestamps; columns_modify_value_for_display_function (function(title, value)) can change any shown value. It gets the column title (Due for %DEADLINE(Due), else the property name) and the real value, and returns the text to show, or nil to show the value as usual (org-columns-modify-value-for-display-function). It applies in column view and in the agenda column view (org-agenda-columns); e and v still use the real value. A relative due date (today, tomorrow, the weekday within a week, else "Oct 8") for a %10DEADLINE(Due) column: |
columns_modify_value_for_display_function = function(title, value)
if title ~= "Due" then
return nil
end
local y, m, d = value:match("(%d%d%d%d)%-(%d%d)%-(%d%d)")
if not y then
return nil
end
local t = os.time({ year = tonumber(y), month = tonumber(m), day = tonumber(d), hour = 12 })
local now = os.date("*t")
local today = os.time({ year = now.year, month = now.month, day = now.day, hour = 12 })
local days = math.floor(os.difftime(t, today) / 86400 + 0.5)
if days == 0 then
return "today"
elseif days == 1 then
return "tomorrow"
elseif days > 1 and days < 7 then
return os.date("%a", t)
end
return os.date("%b ", t) .. tonumber(os.date("%d", t))
end,
The view uses the nearest COLUMNS property's scope; with a keyword/default format it covers the current subtree, or the whole file before the first heading. A count (1<prefix>C, like C-u in Emacs org-columns) always shows the whole file with the file-level format. The buffer's own first #+COLUMNS line takes precedence over one imported with #+SETUPFILE. Like Emacs, the view is drawn over the headlines of the org buffer itself: every headline in scope shows its column row (summaries on parents) in place of its text, the column titles are in the window's winbar (Emacs header-line) and the window gets 'nowrap' and 'virtualedit' so the cursor reaches every column. The buffer text is not changed; body lines stay as they are. The keys below act on the headline and column under the cursor, and keep their usual meaning on other lines; leaving the window or q restores the buffer, its mappings and the window options. Like Emacs, the headline lines are read-only while the view is on: on a column row the keys that change text (i A O x d D S J ~ . ...) and entering Insert mode only say "Text is read-only: Type ‘e’ to edit property"; the view's own keys edit. Rows follow edits of the text; r recomputes. With columns_view = "table" the view is a table in a split instead (with <CR> to jump to the headline). Groups: OrgColumn, OrgColumnTitle. Keys in the view:
| e | edit the value (TODO, tags, dates, ...) |
| n / p | next / previous allowed value (also <S-Right> / <S-Left>): PROP_ALL, TODO keywords, priorities, checkboxes (columns_checkbox_allowed_values), days |
| 1 .. 9 | select the Nth allowed value (digits are not counts in the view) |
| a | edit the allowed values (PROP_ALL): where the entry or an ancestor has them, else at the top of the view (the entry with its COLUMNS, the headline it was opened on, or the start of the file) |
| < / > | narrow / widen the column |
| <M-h> <M-l> | move the column left / right (also <M-Left> / <M-Right>) |
| <M-L> / <M-H> | add a column / delete it (also <M-S-Right> / <M-S-Left>) |
| s | edit the column's attributes |
| <M-k> <M-j> | move the entry up / down (also <M-Up> / <M-Down>) |
| <C-c><C-c> | toggle a checkbox value, else quit |
| <C-c><C-t> | change the TODO state |
| <C-c><C-o> | open the link in the field |
| c / o | contents / overview visibility (overlay view) |
| h l w b | previous / next column (also <Left> <Right> <BS> <Space> <M-b> <M-f>), $ the last one (overlay view: Emacs gives each column one character) |
v view value, r / g refresh, q quit (<CR> jumps to the headline in the table view).
In the overlay view, a key that starts a global mapping or is your leader keeps its usual meaning: <Space> with a space 'mapleader', and g (Neovim's gr* and gx start with it; r refreshes). Leader keys and which-key keep working while the view is open and after it closes. Format changes are saved to the COLUMNS property or the #+COLUMNS: line the view comes from.