Skip to content

feat: insert mode promote/demote heading#1115

Open
celsobenedetti wants to merge 1 commit intonvim-orgmode:masterfrom
celsobenedetti:feat/insert-mode-promote-and-demote
Open

feat: insert mode promote/demote heading#1115
celsobenedetti wants to merge 1 commit intonvim-orgmode:masterfrom
celsobenedetti:feat/insert-mode-promote-and-demote

Conversation

@celsobenedetti
Copy link
Contributor

@celsobenedetti celsobenedetti commented Mar 15, 2026

Summary

This PR extends the standard vim insert mode <C-d> and <C-t> to promote/demote the heading in current line (:help i_CTRL-D).

behavior:

  1. If current line is a heading, promote/demote heading
  2. Else, return default <C-d>/<C-t> behavior

rationale
I think this is intuitive UX, and a neat QoL improvement. This is also the behavior in Doom Emacs.

Changes

  • Introduced two new functions in mappings.lua: insert_mode_promote and insert_mode_demote.
  • Added two new insert mode mappings: <C-d> and <C-t>.

Checklist

I confirm that I have:

  • 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.

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.

1 participant