tweak(python): update smartparens config

- Automatically close f-strings
- Don't insert trailing colons in function definitions
This commit is contained in:
Alexander Graul 2022-02-23 15:01:58 +01:00 committed by Henrik Lissner
parent 86901cca7d
commit 41cbb1fe7b

View file

@ -79,10 +79,13 @@
(setq-local flycheck-python-flake8-executable "flake8"))))
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens
(sp-local-pair 'python-mode "'" nil
:unless '(sp-point-before-word-p
sp-point-after-word-p
sp-point-before-same-p))
;; 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)