Fix evil-org's o/O in nested plain lists
Thanks by @fuxialexander
This commit is contained in:
parent
a0b7ccb74b
commit
38414a636f
2 changed files with 19 additions and 0 deletions
|
@ -427,3 +427,14 @@ with `org-cycle')."
|
||||||
"Auto-align table under cursor and re-calculate formulas."
|
"Auto-align table under cursor and re-calculate formulas."
|
||||||
(when (eq major-mode 'org-mode)
|
(when (eq major-mode 'org-mode)
|
||||||
(+org|realign-table-maybe)))
|
(+org|realign-table-maybe)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +org*evil-org-open-below (orig-fn count)
|
||||||
|
"Fix o/O creating new list items in the middle of nested plain lists. Only has
|
||||||
|
an effect when `evil-org-special-o/O' has `item' in it (not the default)."
|
||||||
|
(cl-letf (((symbol-function 'end-of-visible-line)
|
||||||
|
(lambda ()
|
||||||
|
(org-end-of-item)
|
||||||
|
(backward-char 1)
|
||||||
|
(evil-append nil))))
|
||||||
|
(funcall orig-fn count)))
|
||||||
|
|
|
@ -255,6 +255,10 @@ between the two."
|
||||||
(add-hook! 'org-tab-first-hook #'(+org|indent-maybe +org|yas-expand-maybe))
|
(add-hook! 'org-tab-first-hook #'(+org|indent-maybe +org|yas-expand-maybe))
|
||||||
;; Tell `doom/delete-backward-char' to respect org tables
|
;; Tell `doom/delete-backward-char' to respect org tables
|
||||||
(add-hook 'doom-delete-backward-functions #'+org|delete-backward-char)
|
(add-hook 'doom-delete-backward-functions #'+org|delete-backward-char)
|
||||||
|
;; Don't split current tree on M-RET
|
||||||
|
(setq org-M-RET-may-split-line nil
|
||||||
|
;; insert new headings after current subtree rather than inside it
|
||||||
|
org-insert-heading-respect-content t)
|
||||||
;; Custom keybinds
|
;; Custom keybinds
|
||||||
(define-key! org-mode-map
|
(define-key! org-mode-map
|
||||||
(kbd "C-c C-S-l") #'+org/remove-link
|
(kbd "C-c C-S-l") #'+org/remove-link
|
||||||
|
@ -272,6 +276,10 @@ between the two."
|
||||||
(add-hook 'org-tab-first-hook #'+org|toggle-only-current-fold t)
|
(add-hook 'org-tab-first-hook #'+org|toggle-only-current-fold t)
|
||||||
;; Fix newline-and-indent behavior in src blocks
|
;; Fix newline-and-indent behavior in src blocks
|
||||||
(advice-add #'org-return-indent :after #'+org*return-indent-in-src-blocks)
|
(advice-add #'org-return-indent :after #'+org*return-indent-in-src-blocks)
|
||||||
|
;; Fix o/O creating new list items in the middle of nested plain lists. Only
|
||||||
|
;; has an effect when `evil-org-special-o/O' has `item' in it (not the
|
||||||
|
;; default).
|
||||||
|
(advice-add #'evil-org-open-below :around #'+org*evil-org-open-below)
|
||||||
;; Undo `evil-collection-outline'
|
;; Undo `evil-collection-outline'
|
||||||
(evil-define-key* 'normal outline-mode-map
|
(evil-define-key* 'normal outline-mode-map
|
||||||
"^" nil
|
"^" nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue