👉 Support this work via GitHub Sponsors
tl;dr “<” to trigger org block completion at point.
Screenshot of org-block-capf completion in corfu with corfu-popupinfo-mode enabled for block preview.
Like company-org-block, but for users of the built-in completion-at-point completion or its extensions like corfu, who want similar functionality without the company dependency. org-block-capf is still compatible with company via its company-capf backend.
Check out company-org-block to get a feel for the functionality and capabilities.
To enable org-block-capf, add it to the completion-at-point-functions in org-mode, which you can do via:
(require 'org-block-capf)
(add-hook 'org-mode-hook #'org-block-capf-add-to-completion-at-point-functions)Then, completing the “<” via complete-symbol / completion-at-point in org-mode should let you select an org block.
Alternatively, you can use M-x org-block-capf as an interactive command to complete “<”, which doesn’t require the above setup, as it uses itself as a completion-at-point-function.
Many thanks to Michael Eliachevitch for contributing improvements.