1

I use spacemacs version 0.200.9, and I totally love it. One issue that I have though is when using org-mode. I can't seem to move different levels of the hierarchy up and down as I used to be able to do with the Alt-up or Alt-down key like I used to. I also use the i3wm windows manager, so I think that that these two Alt keys are mapped to the windows manager instead of to emacs.

In spacemacs these shortcuts to move subtree up and down are defined below.

SPC m S l   org-demote-subtree
SPC m S h   org-promote-subtree
SPC m S k   org-move-subtree-up
SPC m S j   org-move-subtree-down

However for some reason these do not seem to work for me either.

So I suppose I need to directly define the keymapping for these 4 features. But I was not sure of the proper way to do that.

I found this issue posted on the spacemacs site.

https://github.com/syl20bnr/spacemacs/issues/3018

I added the following code to my .spacemacs file, but it did not work

  (evil-define-key 'normal evil-org-mode-map
    "SPC o i" 'org-move-subtree-up
    "SPC o m" 'org-move-subtree-down
    "SPC o j" 'org-promote-subtree
    "SPC o k" 'org-demote-subtree)

Can anyone indicate where the error is, or why I can't seem to get org-mode to move org-mode subtrees up or down? Any help would be appreciated.

1
  • Peripherally related - I also use Spacemacs and i3wm, and since Emacs heavily relies on Meta (Alt), I would suggest a different i3 leader key if it's not too engrained in your brain. I use Super instead, and it works nicely.
    – haff
    Jan 9, 2018 at 17:31

1 Answer 1

2

When defining keybindings, if in doubt, wrap them in kbd ie. (kbd "SPC o i"). However spacemacs defines spacemacs/set-leader-keys which enables just (kbd "oi") as your binding.

If you try doing M-: and run (org-move-subtree-up) with an org heading on point and it works but your bindings don't, then that means your bindings were incorrect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.