nvim-orgmode / nvim-orgmode/orgmode

Support `org_do_promote` and `org_do_demote` in visual mode

Open
#860 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core-feature enhancement
Dominant language
Lua
Stars
3.9k
Forks
190
Avg merge
2d 13h
Merged PRs (30d)
7

Description

Does this feature exist in Emacs orgmode core?

N/A

Orgmode link

No response

Feature value

I often need to promote and demote many elements at the same time, for example:

A group of headings:

* Heading 1
** SubHeading 1
** SubSubHeading 1 <-- heading to demote
** SubSubheding 2  <-- heading to demote

The content of a heading (following the case shown in https://github.com/nvim-orgmode/orgmode/issues/859)

* Heading 1
****** SubHeading 1
  - Line 1 <-- content to promote
    - Subline 2 <-- content to promote
  - Line 2 <-- content to promote

The natural way for me is to select all the content in visual mode and use >> or << but it falls back to the default nvim indentation change and adds the spaces:

* Heading 1
** SubHeading 1
  ** SubSubHeading 1 
  ** SubSubheding 2 
* Heading 1
****** SubHeading 1
	  - Line 1
	    - Subline 2
	  - Line 2
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing org_do_promote and org_do_demote commands and how visual-mode mappings currently handle >> and <<. Reproduce the heading and content examples from the issue, then verify that visual selections use Orgmode promotion or demotion without adding ordinary indentation spaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.