diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 4f6997131..5184859b6 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -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)))) ;; diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 1e993f3cd..e58093855 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -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)