Disable smartparens rules for org-mode
They're more troublesome than helpful, but we still want brace autopairing, so leave smartparens-mode on.
This commit is contained in:
parent
2ceac53421
commit
f8090fd09b
1 changed files with 1 additions and 28 deletions
|
@ -715,32 +715,6 @@ compelling reason, so..."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
(defun +org-init-smartparens-h ()
|
|
||||||
"TODO"
|
|
||||||
(after! smartparens
|
|
||||||
(defun +org-sp-point-in-checkbox-p (_id action _context)
|
|
||||||
(and (eq action 'insert)
|
|
||||||
(sp--looking-at-p "\\s-*]")))
|
|
||||||
|
|
||||||
(defun +org-sp-point-at-bol-p (_id action _context)
|
|
||||||
(and (eq action 'insert)
|
|
||||||
(save-excursion
|
|
||||||
(skip-chars-backward "*")
|
|
||||||
(bolp))))
|
|
||||||
|
|
||||||
(defun +org-sp-in-src-block-p (_id action _context)
|
|
||||||
(and (eq action 'insert)
|
|
||||||
(org-in-src-block-p)))
|
|
||||||
|
|
||||||
;; make delimiter auto-closing a little more conservative
|
|
||||||
(sp-with-modes 'org-mode
|
|
||||||
(sp-local-pair "*" "*" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-at-bol-p +org-sp-in-src-block-p))
|
|
||||||
(sp-local-pair "_" "_" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-in-src-block-p))
|
|
||||||
(sp-local-pair "/" "/" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-point-in-checkbox-p +org-sp-in-src-block-p))
|
|
||||||
(sp-local-pair "~" "~" :unless '(:add sp-point-before-word-p +org-sp-in-src-block-p))
|
|
||||||
(sp-local-pair "=" "=" :unless '(:add sp-point-before-word-p sp-in-math-p +org-sp-in-src-block-p)))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Packages
|
;;; Packages
|
||||||
|
|
||||||
|
@ -939,8 +913,7 @@ compelling reason, so..."
|
||||||
#'+org-init-keybinds-h
|
#'+org-init-keybinds-h
|
||||||
#'+org-init-popup-rules-h
|
#'+org-init-popup-rules-h
|
||||||
#'+org-init-protocol-h
|
#'+org-init-protocol-h
|
||||||
#'+org-init-protocol-lazy-loader-h
|
#'+org-init-protocol-lazy-loader-h)
|
||||||
#'+org-init-smartparens-h)
|
|
||||||
|
|
||||||
;;; Custom org modules
|
;;; Custom org modules
|
||||||
(if (featurep! +brain) (load! "contrib/brain"))
|
(if (featurep! +brain) (load! "contrib/brain"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue