refactor(default,python): move smartparens config

Ref: 41cbb1fe7b
This commit is contained in:
Henrik Lissner 2022-04-01 04:38:31 +02:00
parent d54462fe6d
commit 6f8b83b884
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 14 additions and 10 deletions

View file

@ -230,7 +230,20 @@
(sp-local-pair "{-@" "@-}" :actions :rem)
(sp-local-pair "{-" "-")
(sp-local-pair "{-#" "#-")
(sp-local-pair "{-@" "@-")))))
(sp-local-pair "{-@" "@-")))
(after! smartparens-python
(sp-with-modes 'python-mode
;; Automatically close f-strings
(sp-local-pair "f\"" "\"")
(sp-local-pair "f\"\"\"" "\"\"\"")
(sp-local-pair "f'''" "'''")
(sp-local-pair "f'" "'"))
;; Original keybind interferes with smartparens rules
(define-key python-mode-map (kbd "DEL") nil)
;; Interferes with the def snippet in doom-snippets
;; TODO Fix this upstream, in doom-snippets, instead
(setq sp-python-insert-colon-in-function-definitions nil))))
;;

View file

@ -78,15 +78,6 @@
(setq-local flycheck-python-pylint-executable "pylint")
(setq-local flycheck-python-flake8-executable "flake8"))))
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens
;; Automatically close f-strings
(sp-with-modes 'python-mode
(sp-local-pair "f\"" "\"")
(sp-local-pair "f\"\"\"" "\"\"\"")
(sp-local-pair "f'''" "'''")
(sp-local-pair "f'" "'"))
(setq sp-python-insert-colon-in-function-definitions nil) ; interferes with snippet
;; Affects pyenv and conda
(when (featurep! :ui modeline)
(advice-add #'pythonic-activate :after-while #'+modeline-update-env-in-all-windows-h)