org.nvim

Appearance and highlights

Options under ui:

menusthe Org menus (org-menus), default true
choice_prompt"float" (default): pick one of a fixed set of values from a floating list (org-choice-list); "input": the command line with <Tab> completion
imenu_depthheadline levels of imenu (gO), default 2
contextthe sticky headline context (org-context): { enabled = false, max_lines = 3, trim_scope = "outer", line_numbers = true, zindex = 20 }
conceal_linksshow only link descriptions (conceallevel=2)
hide_emphasis_markershide * / _ = ~ + around emphasized text
hide_leading_starsshow only the last star of each headline (#+STARTUP: hidestars / showstars)
bulletslist of symbols replacing the stars, per level
checkboxes{ unchecked, partial, checked } icons
tutor_marksmarks of the exercises of org-tutor done and not yet: { done = "✓", todo = "✗" }
indent_modevirtual indentation like org-indent-mode: the text of a level-n entry starts at column 2n and headlines get n-1 columns of prefix; turns on hide_leading_stars (#+STARTUP: indent / noindent)
indent_mode_turns_off_adapt_indentationadapt_indentation is off in buffers with indent_mode (true)
indent_indentation_per_levelcolumns per level of indent_mode (2): the text of a level-n entry starts after n + (per - 1)(n - 1) + 1 columns, headlines after (per - 1)(n - 1); 0 = no indentation
pretty_entities\alpha → α for every entity of Emacs' org-entities (#+STARTUP: entitiespretty / entitiesplain); x^2 → x², a_{ij} → aᵢⱼ (pretty_entities_include_sub_superscripts, and use_sub_superscripts = true | "{}" | false): Unicode super/subscript characters when all the characters have one, else the script is highlighted with OrgSuperscript / OrgSubscript and only the markers are hidden (Neovim cannot raise text). Entities are shown everywhere but in comment lines and src, example, export and comment blocks (org-differences); scripts not in keyword lines, code, verbatim or links.
numnumber headlines with virtual text like org-num-mode (#+STARTUP: num / nonum); num_max_level, num_skip_commented, num_skip_footnotes, num_skip_tags, num_skip_unnumbered and num_format_function(numbers) -> text follow the org-num options
fontify_done_headlinedim DONE headlines
fontify_todo_headlinehighlight the text of TODO headlines with OrgHeadlineTodo (org-fontify-todo-headline)
fontify_quote_and_verse_blocksthe bodies of quote and verse blocks on OrgQuoteBlock / OrgVerseBlock, under their Org text (org-fontify-quote-and-verse-blocks); false by default like Emacs: Org text only
level_color_stars_onlythe level color on the stars only (org-level-color-stars-only)
hidden_keywordskeywords shown without their "#+KEYWORD:" part: { "title", "subtitle", "author", "date", "email" } (org-hidden-keywords)
hide_macro_markershide the {{{ }}} of macro calls (org-hide-macro-markers)
highlight_latex_and_relatedwhat LaTeX-related syntax is highlighted (org-highlight-latex-and-related), none by default like Emacs: "latex" (fragments $..$, \(..\), \[..\], $$..$$ and \begin{..} environments, OrgLatex), "native" (the same drawn by Vim's tex syntax, with the entities and scripts listed; org-highlighter-latex), "script" (x^2, a_{i}), "entities" (\alpha)
src_highlighthighlight src blocks in their language (org-src-fontify-natively); false: plain text
src_highlight_engine"auto" (default): with tree-sitter when Neovim has a parser and a highlights query for the language, else with its Vim syntax; "treesitter": tree-sitter only (other languages stay plain); "syntax": the Vim syntax only. See org-src-highlight.
src_block_facesface of src block bodies by language, like todo_keyword_faces: { python = { bg = "#e5ffb8" } } ("" = blocks without a language) (org-src-block-faces)
todo_keyword_faces{ WAITING = ":foreground #e0af68 :weight bold" }, or a highlight table, or a group name
priority_facesthe same per priority (org-priority-faces): { A = "ErrorMsg", ["10"] = { fg = "gray" } }
tag_facesthe same per tag (org-tag-faces)
<C-c><C-x>\Toggle pretty entities in the buffer (org-toggle-pretty-entities, toggle_pretty_entities).
:Org entities_helpList every entity with its LaTeX and HTML code (org-entities-help).

entities_user (org-entities-user) adds entities of your own, or replaces built-in ones, for display, completion and export:

entities_user = {
  -- name, LaTeX, LaTeX needs math mode, HTML, ASCII, Latin-1, UTF-8
  { "snowman", "\\diamond", true, "&#9731;", "[snow]", "[snow]", "☃" },
}

Sticky headline context

Like nvim-treesitter-context, a floating window over the top rows of an org window shows the headlines the first line on screen is under, so you know where you are in a long, deeply nested document. The lines are drawn as in the buffer: stars or bullets, TODO keywords, priorities, tags, concealed links. It is off by default, since it covers lines of the window; turn it on with ui.context.enabled = true or :Org context_toggle. Options under ui.context:

enabledshow it in every org window (false)
max_linesmost headlines shown (3); a window keeps at least one line of its own
trim_scopewith more headlines than that, drop the "outer" (outermost, default) or the "inner" ones
line_numbersthe headlines' line numbers in the gutter of windows with 'number' or 'relativenumber' (true)
zindexof the floats (20)

What counts is the line under the float: when the lines it covers end the entry, the context gets shorter. A closed fold is one line. Each window has its own context, which follows scrolling, resizing, folding and edits; it is closed when the window shows a buffer that isn't an org buffer, or closes. The cursor can be under the float, as with nvim-treesitter-context: a 'scrolloff' of at least max_lines keeps it in view. Set vim.w.org_context or vim.b.org_context to false to leave a window or a buffer without one.

With nvim-treesitter-context installed nothing needs doing: it draws nothing in org buffers, which have no tree-sitter parser. When Neovim does have an org parser and nvim-treesitter-context is on, org buffers are left to it, so the two floats never cover each other (vim.b.org_context = true asks for org.nvim's).

:Org context_toggleTurn the sticky context on or off in every window.
:Org context_gotoGo to the innermost headline of the context; with a count, to the one that many levels out (m' is set).

Neither has a default key; map them with mappings.org. Highlight groups: OrgContext (the float, linked to NormalFloat), OrgContextLineNumber (LineNr) and OrgContextBottom (its last line, underlined).

:Org num_modeToggle headline numbering in the buffer (org-num-mode).
:Org indent_modeToggle virtual indentation in the buffer (org-indent-mode).

Turning indent mode or numbering on or off, also when a buffer starts with them, runs the User autocmd OrgIndentMode or OrgNumMode (org-indent-mode-hook, org-num-mode-hook), data.enabled telling which.

Images and LaTeX previews

Image links and LaTeX fragments can be shown as images in place of their text, like Emacs (org-link-preview, org-latex-preview). A backend draws them, chosen with ui.images.backend:

"native"vim.ui.img, Neovim 0.13+, in a terminal with the Kitty graphics protocol (kitty, Ghostty, WezTerm...). Support is checked once by asking the terminal. Not through tmux.
"snacks"Snacks.image from snacks.nvim (also inside tmux, with allow-passthrough on). For Neovim before 0.13.
"image.nvim"3rd/image.nvim.
"auto"(default) the first of these that works; false turns previews off. :checkhealth org tells which one is used.

With the native backend, the text of the link is concealed behind blank inline text as wide as the image, virtual lines keep the rows the image needs under the line free, and the images are placed on the screen after every redraw, so they follow scrolling, folding, window splits and resizes, also in floating windows. Images are sized for each window and sized again when it is resized; in a window too narrow for an image the image is not drawn. When a line wraps after an image, the image is drawn under the line and the link text stays visible; on the first line of a closed fold, an image taller than one row shows its link text. An image is shown once all of it fits in the window, and hidden under floating windows and the popup menu. Only PNG can be sent to the terminal: other formats are converted with ImageMagick (magick). Sizes come from the terminal's cell size in pixels. Editing a previewed link or fragment removes its preview.

Placement, ui.images.placement:

"inline"(default) the image replaces the link or fragment: its top row is on the line, at the link's column, and the text after the link moves right to make room. The rows under the line are shared by the images of that line (side by side). An image is at most as wide as the columns left after the text before it. On the cursor line of the current window the text shows again, in every mode, with the image under the line, so it can be edited; moving off the line puts the image back in place. The windows showing the buffer get 'conceallevel' 2. Inline math ($x$, \(x\)) is scaled to one row, as tall as the text; other fragments keep their size. A fragment or environment over several lines is drawn in place too (Neovim 0.11+): its other lines are hidden (conceal_lines), the image starts on its first line and the text after it on its last line follows the image; the cursor on any of its lines shows the text again, with the image under its last line. Before 0.11 such fragments use "below", and image.nvim always does.
"below"under the line, at the link's column, the text left as it is (images of one line are stacked).
<prefix>xv, <C-c><C-x><C-v>org-link-preview (link_preview): on a link, toggle its preview; else preview the links of the current entry, or of the Visual selection, again when called again. A count like the Emacs prefix: 4 hides the preview at the cursor, else the entry's (or the selection's); 16 previews the whole buffer, 64 hides them all; 1 also previews links with a description (entry, link or selection), 11 in the whole buffer, any other count in the whole buffer too.
<prefix>xV, <C-c><C-x><C-M-v>org-link-preview-refresh (link_preview_refresh): preview every image link of the buffer again.
<prefix>xl, <C-c><C-x><C-l>org-latex-preview (latex_preview): on a fragment, toggle its preview; else render the fragments of the current entry (or of the Visual selection). 4 hides the entry's (or selection's) previews, 16 previews the whole buffer, 64 hides them all. Rendering runs in the background.

The same as ex commands; a range limits them, a number is the count:

  • :[range]Org link_preview [N]
  • :[range]Org latex_preview [N]
  • :[range]Org link_preview_region [linked] (org-link-preview-region)
  • :[range]Org link_preview_clear (org-link-preview-clear)
  • :Org link_preview_refresh
  • :[range]Org clear_latex_preview (org-clear-latex-preview)

Without a range the last three act on the whole buffer. The obsolete Emacs names work too: toggle_inline_images, remove_inline_images, redisplay_inline_images, toggle_latex_fragment, preview_latex_fragment.

Which links: links of a type with a preview function (org-link-set-parameters :preview), with no description, or whose description is a sole plain or angle link of such a type ([[https://example.com][file:thumb.png]] shows thumb.png); with a count of 1 (or linked) the links with a description are previewed by their own target. Built in: file: and attachment: links (bracket, plain or angle) to an existing file whose extension is in ui.images.extensions, and http(s) links to such a file name when ui.images.remote allows. Links in src, example, export and comment blocks, comments, fixed-width lines and property drawers are left alone, like Emacs.

Preview functions (org-link-set-parameters :preview) come from links.types.<type>.preview, else from org.ui.images.set_preview():

require("org.ui.images").set_preview("thumb", function(path, ctx)
  return vim.fn.expand("~/thumbs/" .. path .. ".png")
end)

The function gets the link's path and a context { bufnr, row (1-based), col, end_col (0-based), type, link, refresh, callback } and returns the image file to show, nil or false for none, or true when it calls ctx.callback(file) later (after a download, say). A type org.nvim does not know becomes a link type (links.types), and a function registered for file or attachment replaces the built-in one.

set_preview({type}, {fn}) registers {fn} for {type} links, or removes it when {fn} is nil.

Remote images (org-display-remote-inline-images), ui.images.remote:

"skip"(default) http(s) links are not previewed;
"download"the image is fetched with curl on every preview;
"cache"fetched once into stdpath("cache")/org/remote-images, and again by link_preview_refresh.

Emacs applies this to TRAMP files; org.nvim has no TRAMP and uses it for http(s) image links instead.

Batches (org-link-preview-batch-size, org-link-preview-delay): the first ui.images.batch_size links (6) are previewed at once, the others in batches of that size every ui.images.preview_delay seconds (0.05), so a long file stays responsive; 0 previews all at once. Clearing previews (or editing the link) drops the links still waiting.

Size (org-display-inline-image--width): ui.images.actual_width is

true(default) the image's own size;
a numberthat many pixels;
false, { n }the :width of the paragraph's #+ATTR_ORG, else of another #+ATTR_x with a readable width, else n pixels (or the own size). :width is pixels (300, 300px), a percentage (50%) or a fraction from 0 to 2 (0.5, 0.7\linewidth) of the text width ('textwidth', else the window), or t (own size).

An ORG-IMAGE-ACTUAL-WIDTH property (inherited: t, nil, a number or (n)) overrides it. ui.images.max_width (org-image-max-width) caps the width: "fill-column" ('textwidth', else 70 columns), "window", a number of pixels or a fraction of the window. ui.images.max_height caps the rows. The own size is read from the file: PNG, JPEG, GIF, BMP and WebP with every backend, other formats (SVG, TIFF, ...) only with the native one, which draws a PNG copy; snacks and image.nvim get those in a box as wide as the cap and 10 rows high, and fit the image into it.

Alignment (org-image-align): an image link alone in its paragraph is drawn at ui.images.align ("left", "center" or "right"), or as its #+ATTR_ORG (else #+ATTR_x) says with :align center|right|left or :center t. Native backend only.

TAB cycling (org-cycle-link-previews-display): with ui.images.cycle_display, showing an entry's children previews its own links, showing the subtree previews all of them, and folding it removes them.

At startup: #+STARTUP: linkpreviews (inlineimages) and latexpreview preview a file when it opens, like ui.images.startup and ui.latex_preview.startup; the no... words turn that off, and the last word of a pair wins.

LaTeX fragments are those org-latex-preview renders: $x$ (no blank after the opening or before the closing dollar, no $ before it, a blank, punctuation or line end after it), $$x$$, \(x\) and \[x\], which may span lines of a paragraph, and \begin{env} ... \end{env} environments with the \end alone on its line. Fragments in verbatim or code markup, link targets, blocks other than quote/verse/special blocks, and keywords other than TITLE, CAPTION, AUTHOR and DATE are skipped.

Rendering follows org-create-formula-image with the process named by ui.latex_preview.process (org-preview-latex-default-process), from processes (org-preview-latex-process-alist):

"dvipng"latex + dvipng (the Emacs default)
"dvisvgm"latex + dvisvgm (SVG, converted to PNG for vim.ui.img)
"xelatex"xelatex + dvisvgm
"imagemagick"pdflatex + convert
"tectonic"tectonic + pdftocairo (org.nvim)
"pdflatex"pdflatex + pdftocairo (org.nvim)

"auto" (default) uses the first of dvipng, dvisvgm, tectonic, pdflatex, imagemagick that is installed. A process is a table with programs, message, image_input_type, image_output_type, image_size_adjust ({ buffer, html }), latex_header, latex_compiler, image_converter and transparent_image_converter; commands run in a shell in a temporary directory, with %f (input file), %F (its full path), %b (base name), %o (output directory), %O (output file), %D (DPI) and %S (scale, DPI / 140). processes adds or replaces entries.

The document is ui.latex_preview.header (org-format-latex-header, the Emacs header by default) with [DEFAULT-PACKAGES] and [PACKAGES] filled from export.latex and the file's #+LATEX_HEADER lines (SETUPFILE too), like org-latex-make-preamble for snippets. foreground is "default" (the Normal text), "auto" (the text at the fragment) or a color; background is "default" (Normal), "Transparent" or a color (:foreground, :background). Formulas are about as tall as a text line times scale. Images are written to ui.latex_preview.image_directory (org-preview-latex-image-directory, "ltximg/" next to the file; buffers without a file use stdpath("cache")/org/ltximg), or to cache_dir when set. When a step fails, its output is in the *Org Preview LaTeX Output* buffer.

Where images work

Previews depend on three things outside org.nvim: the Neovim version, the terminal, and what sits between them (tmux, zellij, SSH). :checkhealth org shows what it found and which backend it uses.

Which backend draws the images ("auto"):

  1. "native" (vim.ui.img) when Neovim is 0.13 or newer AND the terminal answers the Kitty graphics query. The query is asked once, the first time a preview is made, and waits up to 1 s when nothing answers.
  2. else "snacks" when snacks.nvim is installed with its image module and the terminal supports it with unicode placeholders;
  3. else "image.nvim" when it is installed;
  4. else no previews, with a message saying why.

Set ui.images.backend to a name to skip the others (and the 1 s wait).

Setups:

kitty, Ghostty (Neovim 0.13+)native: everything below works.
WezTerm (Neovim 0.13+)native. WezTerm's Kitty graphics support is partial; snacks.nvim can't draw in it (no unicode placeholders): with an older Neovim use image.nvim.
Neovim 0.11 and 0.12no vim.ui.img: snacks.nvim or image.nvim, in a terminal they support.
tmuxvim.ui.img writes straight to the terminal and tmux drops it, so its query gets no answer (the 1 s wait) and "auto" falls back to snacks.nvim. It needs set -g allow-passthrough on in tmux.conf (snacks.nvim tries to set it). Or run Neovim outside tmux.
zellijno passthrough: no backend can draw.
SSHnative and snacks.nvim send the image data through the connection. Images, ImageMagick and the LaTeX programs must be on the machine running Neovim.
Terminal.app, iTerm2, Alacritty, Windows Terminal, GNU screenno Kitty graphics protocol: no native or snacks.nvim previews. image.nvim may still work there (e.g. with ueberzug on Linux).

What each backend does:

native snacks image.nvim
image in place of its linkyesyes (5)no (below)
image under its linkyesyes (1)yes
:align / org-image-alignyesnono
follows scrolling and foldsyesyesyes
under floating windows, menushidden (2)covered (4)its backend
partly visible imageshidden (3)cutcut
several windows on one bufferyesyesfirst only
(1)A link alone on its line gets its image at the link's column. With text around the link, snacks.nvim draws the image at the start of the next line and puts an icon at the link.
(2)So they don't cover menus; they come back when the float closes.
(3)vim.ui.img can't crop: an image is drawn once all of it fits.
(4)snacks.nvim draws images as text (unicode placeholders), so floats cover them like any text.
(5)snacks.nvim conceals the text itself; an image with text after it on a line may go under the line with an icon at the link.

When it goes wrong:

"no image backend" or "does not support the Kitty graphics protocol"Neovim is older than 0.13, the terminal lacks the protocol, or tmux or zellij is in between (see above). Install snacks.nvim or image.nvim, run Neovim outside tmux, or use another terminal.
Nothing happens for a second on the first previewThe terminal query waiting for an answer (tmux, unsupported terminals). Set ui.images.backend.
Blank rows under the link (or a blank gap in place of it) but no imageThe native backend reserved the rows but the image is not fully visible, a float covers it, or the terminal ignored it. Scroll it into view; check :checkhealth org.
An image is not where the link is, or everything looks centered:align and org-image-align only work with the native backend; with snacks.nvim see (1) above. Images starting where the link text ends was a bug fixed in org.nvim (update).
"can't convert ... to PNG"The native backend only sends PNG: install ImageMagick (magick) for JPEG, SVG and the rest.
An image vanished (the terminal was cleared or reset)<prefix>xV (link_preview_refresh) draws them again.
Images the wrong size after changing the font sizeSizes come from the terminal's cell size, read again when Neovim is resized; <prefix>xV redraws them.
LaTeX: "no LaTeX renderer found" / "you need to install the programs"Install latex and dvipng (or tectonic and poppler for pdftocairo). When a render fails, its output is in *Org Preview LaTeX Output*.

Emphasis follows org-emphasis-regexp-components: the markers need a space, (, ', ", { or - (or the line start) before them, may span one line break, and bold, italic, underline and strike-through can nest.

Org buffers are drawn by the parser highlighter: the decoration provider, from a scan of the lines on screen (org.ui.highlight and its parts, emphasis and hidden link parts in org.ui.emphasis). Vim :syntax only draws the languages of src and export blocks that tree-sitter doesn't (org-src-highlight), as regions over their bodies.

It ports Emacs's own fontification (org-set-font-lock-defaults: org-fontify-meta-lines-and-blocks, org-do-emphasis-faces, org-activate-links, ...). On the example files and the fixtures of hard cases (26,503 lines), it draws the faces Emacs Org 9.8.12 draws on every byte of all but 9 lines, each a known difference with its reason (tests/spec/emacs_faces_*_spec.lua, against tests/fixtures/emacs/faces/). Every marker that can open emphasis is tried on its own, so markup may overlap the way it does in Emacs (*a /b* c/ is bold and italic), nested and overlapping faces combine (bold inside a headline keeps the headline's color), markup in link descriptions, macros, property values and comment blocks is drawn, and verbatim and code show the link brackets and markers inside them. Its scan takes time linear in the length of a line, so it has none of the limits of syntax regions: everything is drawn past 'synmaxcol' and markup over two lines however long the first is, a long line full of markers can't run out of 'maxmempattern' (E363) and turn highlighting off, and an emphasis or block whose end can't be found never runs on over the lines below. Typing computes again only the rows an edit inside a line can change (an edit of a headline's text too, not of its stars), however much of the file was drawn before. Loading it sets LuaJIT's sizemcode (the size of each machine code area) to 256 KB: on arm64, a new area of the default size often couldn't be placed once a large file was open, and every compiled trace was thrown away each time.

It draws with the highlight groups below (OrgBold, OrgVerbatim, ..., and the org... group names linked to them, such as orgBoldDelimiter, so a colorscheme that sets either keeps working) and follows ui.hide_emphasis_markers, ui.conceal_links, toggle_link_display and the cursor rules of org-conceal-cursor. What it draws isn't a syntax group, so synID(), synstack() and :Inspect don't report it (plugins that ask the syntax what is under the cursor see plain text there; :Org inspect lists it). Only once a src block's language is drawn by its Vim syntax do the bodies of src, export, example and comment blocks get syntax regions: the language's, and orgBlockRaw (no colour) keeping the others raw text. A buffer that sets 'syntax' to org without being an org buffer, like the drill window, is drawn by it too, until its 'syntax' changes. What isn't prose (verbatim, code, links, timestamps, ...) is left out of spell checking with extmarks (org-highlighter-spell), and ui.highlight_latex_and_related "native" draws fragments with marks of Vim's tex groups (org-highlighter-latex). Calling setup() again draws the org buffers already open with the new options. An error raised while drawing (a bug: please report it) is shown once, and the window it happened in is drawn without the highlighting while the error lasts.

With 'spell' set, ]s, [s, z= and spellbadword() skip what the screen leaves out. Checked: paragraphs, headline titles, list items, comments, quote and verse blocks, the text of bold, italic, underline and strike-through (in table rows too, where nothing else is checked). Not checked: the TODO keyword, priority and tags of a headline, keywords (#+TITLE: and the like, the keyword and its value), block delimiter lines, src, example and export blocks (but what the language's syntax checks, such as its comments), tables, drawer lines and properties, planning and clock lines, timestamps, links (their description too: Emacs removes flyspell's marks from links), footnote labels, targets, macros, inline src blocks, export snippets, LaTeX, verbatim and code. It follows what Emacs's flyspell checks (org-mode-flyspell-verify, which asks org-element): it checks the body of comment blocks and the text of #+CAPTION: (not its links and timestamps), and the footnotes, targets and inline src blocks of a comment; it doesn't check the emphasis in a list item's tag, a link over two lines, or keyword and block lines in a quote block; and verbatim is what org-element finds, left to right, so =a "b"=, the rest= checks ", the rest" (font-lock, which tries every marker, draws it as verbatim too).

With ui.highlight_latex_and_related = { "native" }, the parser highlighter draws what it finds ($x$, \(..\), \[..\], $$..$$ and \begin{..} environments, and the entities and scripts when listed too) the way Emacs's org-do-latex-and-related does then: the text is drawn as a TeX file of its own would be, with the groups of Vim's tex syntax (texMathZoneX, texStatement, ...), over orgSrcBlock (org-block, as the body of a src block drawn by its language), and in place of OrgLatex. It is shown as typed: tex's concealing and its error groups are left out. Without a tex syntax on 'runtimepath', fragments get OrgBlock alone. Like Emacs, nothing is drawn where the byte after the start of the match is verbatim, code, underline or a special keyword. The tex groups are marks, not syntax: synstack() and :Inspect don't list them (:Org inspect does). A fragment seen first while the screen is drawn gets its colours right after, on the next redraw. Difference: Emacs takes the faces of bold, italic and the like off a fragment drawn natively; here the tex groups only go over them.

:Org inspect (no default key) shows what is drawn under the cursor, like :Inspect but with the marks it doesn't see: the decorations and the parser highlighter's groups (drawn anew on each redraw, ephemeral extmarks) and citations, each with its priority, whether it is spell checked and whether it hides the text, then the syntax groups, tree-sitter captures and extmarks :Inspect lists.

Quote and verse block contents are highlighted as ordinary Org (lists, tables, timestamps, markup), on top of OrgQuoteBlock (quote) and OrgVerseBlock (verse, linked to OrgQuoteBlock) only with ui.fontify_quote_and_verse_blocks (off by default, as Emacs's org-fontify-quote-and-verse-blocks); center, special (#+begin_note...) and dynamic (#+BEGIN:) blocks highlight only their delimiter lines. Every block ends at the next headline, whether or not it has its #+end line. #+begin_export LANG blocks get LANG's syntax, as #+begin_src LANG blocks do. A buffer's #+OPTIONS: ^:t, ^:{} or ^:nil overrides ui.use_sub_superscripts, for pretty entities and for the "script" LaTeX highlighting (^:nil displays like ^:{}, as in Emacs). Complete statistics cookies ([2/2], [100%]) use OrgStatisticDone, others OrgStatistic (org-checkbox-statistics-done/-todo); OrgSexpDate is diary sexps (<%%(...)>, %%(...) lines) and OrgArchived the text of headlines tagged ARCHIVE.

The body of a #+begin_src org block (and of #+begin_export org and #+begin_example org, as Emacs fontifies them too) is drawn as Org text on OrgBlock, the way Emacs's org-src-fontify-natively draws it: as if the body were a buffer of its own (keywords, comments, lists, tables, drawers, timestamps, footnotes, links and markup, and blocks that open and close in it), from the lines around the rows on screen like the rest of the buffer. As in Emacs, the lines are taken as typed: a line escaped with a comma (,* Heading, ,#+TITLE:) is no headline or keyword there, and nothing in the body is hidden (emphasis markers and link brackets show, the markers without the emphasis face when ui.hide_emphasis_markers is on). The language is matched as Emacs does, case and all, through src_lang_modes (a language mapped to "org" is drawn the same); ui.src_highlight = false leaves the body plain OrgBlock. The body is never drawn with a tree-sitter org parser or a Vim syntax for org, even when one is installed: this drawing wins.

An inline src block (src_LANG{BODY}) is drawn wherever its text is, as Emacs's org-fontify-inline-src-blocks does: in a headline, a table, a list term, a link description, a comment, a keyword line, or the body of a block. Its braces and body don't take the face of what they are in (OrgInlineSrcMarker and OrgInlineSrc alone, no headline, table, link or OrgBlock colour under them), while src_LANG and [HEADERS] keep it under their own. What a link hides stays hidden. In the body of a src or export block, the language's Vim syntax still draws under the braces (a decoration can't take a syntax group's attributes off, so <b>src_sh{x}</b> in an html export block keeps its bold).

Highlight groups (all default, override with nvim_set_hl()): The parser highlighter (org-highlighter) draws these and the org... group names linked to them (orgBoldDelimiter, orgLinkPlain, ...; group names ignore case, so orgTodo is OrgTodo), as decorations, not syntax groups.

  • OrgHeadlineLevel1..8 (linked to the colorscheme's markdown headings)
  • OrgTodo, OrgDone, OrgHeadlineTodo, OrgHeadlineDone, OrgHeadlineComment, OrgPriority, OrgPriorityA, OrgPriorityB, OrgPriorityC, OrgTags, OrgTimestamp, OrgTimestampInactive, OrgPlanning, OrgClockDuration, OrgClockSum, OrgDrawer, OrgPropertyKey, OrgPropertyValue, OrgKeyword, OrgKeywordValue, OrgTitle, OrgComment, OrgBlock, OrgQuoteBlock, OrgVerseBlock, OrgBlockDelimiter, OrgBold, OrgItalic, OrgUnderline, OrgStrikethrough, OrgVerbatim, OrgCode, OrgLink, OrgListBullet, OrgListTerm, OrgCheckbox, OrgCheckboxChecked, OrgCheckboxPartial, OrgStatistic, OrgStatisticDone, OrgTable, OrgTableSeparator, OrgTableFormula, OrgSexpDate, OrgArchived, OrgInlineSrc, OrgInlineSrcMarker, OrgInlineSrcLang, OrgExportSnippetMarker, OrgExportSnippetBackend, OrgFootnote, OrgTarget, OrgLatex, OrgHorizontalRule, OrgMacro, OrgHiddenStars, OrgSuperscript, OrgSubscript, OrgInlinetask, OrgInlinetaskFirstStar, OrgSparseMatch, OrgBabelRunning, OrgBabelOutput, OrgCommandPreview
  • OrgContext, OrgContextLineNumber, OrgContextBottom (org-context)
  • OrgMenuKey, OrgMenuHeading, OrgMenuDesc, OrgMenuMore, OrgMenuOn, OrgMenuOff, OrgMenuValue, OrgMenuSelected (org-key-menus, org-choice-list)
  • OrgTutorDone, OrgTutorTodo, OrgTutorProgress (org-tutor)
  • OrgAgenda*