I installed a package that changes emacs windows using Shift+arrow, and it works in various modes I use but not in org-mode. Is there a reason why org-mode shadows this command?
2 Answers
Add the following to your config, like described in "Packages that conflict with Org mode":
(add-hook 'org-shiftup-final-hook 'windmove-up)
(add-hook 'org-shiftleft-final-hook 'windmove-left)
(add-hook 'org-shiftdown-final-hook 'windmove-down)
(add-hook 'org-shiftright-final-hook 'windmove-right)
Set org-support-shift-select
customization variable to "Everywhere except timestamps" (setq org-support-shift-select 'always)
, otherwise shift+arrows will still have org-mode keybidnings on headings.
In Emacs 26.2 you only need to set the variable org-replace-disputed-keys
to true while enabling windmove-default-keybindings
to have the default windmove keybindings work normally. You don't need to configure the variable org-support-shift-select
as said by the answer of kolen if you don't need the shift selection function because enabling default windmove keybindings will disable shift selection automatically (see C-h i g (emacs)Window Convenience
). You only need to add
(add-hook 'org-shiftup-final-hook 'windmove-up)
(add-hook 'org-shiftleft-final-hook 'windmove-left)
(add-hook 'org-shiftdown-final-hook 'windmove-down)
(add-hook 'org-shiftright-final-hook 'windmove-right)
to init file if you want to keep the original org mode keybindings on regions where they take effect such as headings or list items and enable windmove on other regions (see C-h i g (org)conflicts
). You may need to restart Emacs after making these changes to let them take effect.
org-mode-map
key bindings: stackoverflow.com/a/17540326/2112489 That approach will permit global key bindings to be used again.windmove
?). Have a look at orgmode.org/manual/Conflicts.html.framemove
.