Automatically newline with block start
This commit is contained in:
parent
6283c1afd7
commit
41e153058c
1 changed files with 6 additions and 1 deletions
|
@ -37,7 +37,12 @@
|
||||||
|
|
||||||
(defun prelude-python-mode-defaults ()
|
(defun prelude-python-mode-defaults ()
|
||||||
"Defaults for Python programming."
|
"Defaults for Python programming."
|
||||||
(subword-mode +1))
|
(subword-mode +1)
|
||||||
|
(setq-local electric-layout-rules
|
||||||
|
'((?: . (lambda ()
|
||||||
|
(if (python-info-statement-starts-block-p)
|
||||||
|
'after)))))
|
||||||
|
(electric-layout-mode +1))
|
||||||
|
|
||||||
(setq prelude-python-mode-hook 'prelude-python-mode-defaults)
|
(setq prelude-python-mode-hook 'prelude-python-mode-defaults)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue