prelude
prelude copied to clipboard
Org mode windmove disable
Because of keybinding clash.
Fixes #1364
Before submitting the PR make sure the following things have been done (and denote this by checking the relevant checkboxes):
- [X] The commits are consistent with our contribution guidelines
- [X] You've updated the changelog (if adding/changing user-visible functionality)
Thanks!
@tesujimath I have been trying this solution to have org mode shift keybindings take precedence over windmove:
;; Advice to redirect windmove commands to org-mode functions in org buffers
(defun ap/windmove-left-advice (orig-fun &rest args)
"Use org-mode shift-left in org buffers, windmove-left elsewhere."
(if (derived-mode-p 'org-mode)
(org-shiftleft)
(apply orig-fun args)))
(defun ap/windmove-right-advice (orig-fun &rest args)
"Use org-mode shift-right in org buffers, windmove-right elsewhere."
(if (derived-mode-p 'org-mode)
(org-shiftright)
(apply orig-fun args)))
(defun ap/windmove-up-advice (orig-fun &rest args)
"Use org-mode shift-up in org buffers, windmove-up elsewhere."
(if (derived-mode-p 'org-mode)
(org-shiftup)
(apply orig-fun args)))
(defun ap/windmove-down-advice (orig-fun &rest args)
"Use org-mode shift-down in org buffers, windmove-down elsewhere."
(if (derived-mode-p 'org-mode)
(org-shiftdown)
(apply orig-fun args)))
;; Apply advice to all windmove functions
(advice-add 'windmove-left :around #'ap/windmove-left-advice)
(advice-add 'windmove-right :around #'ap/windmove-right-advice)
(advice-add 'windmove-up :around #'ap/windmove-up-advice)
(advice-add 'windmove-down :around #'ap/windmove-down-advice)
Does this achieve the results you are looking for?
If so I can try to make a PR.
I will try that, but not imminently sorry, am away from my computer. Thanks for posting!