Skip to content

Conversation

@aaratha
Copy link
Contributor

@aaratha aaratha commented Dec 19, 2025

Summary

This PR adds org-insert-drawer and org-insert-property-drawer functionality to nvim-orgmode via new insert_drawer and insert_properties_drawer functions and keymaps: <prefix>iD & <prefix>ip

org-insert-drawer

Inserting drawers using the keymap prompts the user to input a drawer name and places it below the cursor.

org-insert-property-drawer

Emacs requires a prefix (e.g. count 1) by default to use org-insert-property-drawer. This is problematic for testing, and no other nvim-orgmode functions this way. Instead, this implementation uses a separate function and keymap to insert a property drawer below the current headline.

Related Issues

Closes #519

Changes

  • Adds insert_drawer function to mappings.lua
  • Adds insert_property_drawer function to mappings.lua
  • Adds function mappings to mappings/init.lua
  • Adds keymaps <prefix>iD and <prefix>ip to defaults.lua
  • Adds insert_drawer and insert_property_drawer tests to new file insert_drawer_spec.lua

Checklist

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

+ Inserts drawer with inputted name under cursor or inserts properties
drawer under current headline if binding is called with prefix (e.g.
count 1)
+ Adds tests for drawer insertion functionality
…keybind

Fixes prefix count testing issues by splitting insert_drawer and
insert_properties_drawer into two different functions and bindings

- insert drawer <prefix>iD
- insert properties drawer <prefix>ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

org-insert-drawer and org-insert-property-drawer

1 participant