From f00210f9a45e950fe256bd44cca7bc80600c6684 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 4 Jun 2019 17:03:13 +0200 Subject: emacs: added python environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- emacs/init.org | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'emacs/init.org') diff --git a/emacs/init.org b/emacs/init.org index 3af3ab1..824b3dd 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1978,6 +1978,29 @@ And now my Go configuration. This includes stuff like the usage of =goimports=, (add-hook 'go-mode-hook 'mssola-go-mode)) #+END_SRC +** Python + +Install =elpy= as the environment for Python support: + +#+BEGIN_SRC elisp +(use-package elpy + :ensure t + :config + (advice-add 'python-mode :before 'elpy-enable) + (when (require 'flycheck nil t) + (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) + (add-hook 'elpy-mode-hook 'flycheck-mode))) +#+END_SRC + +Automatically use =autopep8= on save: + +#+BEGIN_SRC elisp +(use-package py-autopep8 + :ensure t + :config + (add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)) +#+END_SRC + ** Rust Install =rust-mode= and add some hooks to make it friendlier. -- cgit v1.2.3