Skip to content

Instantly share code, notes, and snippets.

@lislon
Created November 24, 2015 13:38
Show Gist options
  • Select an option

  • Save lislon/dddd86ad1137f85ea187 to your computer and use it in GitHub Desktop.

Select an option

Save lislon/dddd86ad1137f85ea187 to your computer and use it in GitHub Desktop.
(defun my/org-metaright-or-evil-shift-right-advice (orig-func &rest args)
"Overrides org-metaright if cursor is not at heading or item"
(if (org-at-heading-or-item-p)
(apply orig-func args)
(call-interactively 'evil-shift-right))
)
(defun my/org-metaleft-or-evil-shift-left-advice (orig-func &rest args)
"Overrides org-metaleft if cursor is not at heading or item"
(if (org-at-heading-or-item-p)
(apply orig-func args)
(call-interactively 'evil-shift-left))
)
(advice-add 'org-metaright :around #'my/org-metaright-or-evil-shift-right-advice)
(advice-add 'org-metaleft :around #'my/org-metaleft-or-evil-shift-left-advice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment