evil-org-mode icon indicating copy to clipboard operation
evil-org-mode copied to clipboard

Should we add [[ and ]] bindings

Open Somelauw opened this issue 7 years ago • 2 comments

Problem

At the moment, [[ mostly behaves like org-backward-element ]] mostly behaves like org-forward-element

These bindings aren't perfect, because if ]] is used on the penultimate element it jumps back instead.

For example

* main heading
** subheading1
** subheading2 (Pressing ]] here goes back to main heading instead of subheading3)
** subheading3

Solution

We can fix this by binding ]] directly to org-forward-element, but since we already have gj and gk for org-forward/backward-element, it might also be an option to bind them to something else. One idea is to bind [[ to org-previous-visible-heading and ]] to org-next-visible-heading.

Question

What should [[ and ]] be bound to? Also, what to do with [] and ][?

Somelauw avatar Jul 30 '17 22:07 Somelauw

Here is an idea for these bindings:

    "[[" 'org-backward-heading-same-level ; C-c C-b
    "]]" 'org-forward-heading-same-level  ; C-c C-f
    "[m" 'org-previous-visible-heading    ; C-c C-p
    "]m" 'org-next-visible-heading        ; C-c C-n
    "[x" 'org-previous-link               ; C-c C-x C-p
    "]x" 'org-next-link                   ; C-c C-x C-n
    "[v" 'org-babel-previous-src-block    ; C-c C-v C-p
    "]v" 'org-babel-next-src-block      ; C-c C-v C-n

Somelauw avatar Nov 04 '17 12:11 Somelauw

Would you include [] and ][ for navigating to just inside the header? (I.e. exclusive of the header)?

BlueDrink9 avatar Sep 23 '21 04:09 BlueDrink9