aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2019-06-04 17:03:13 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2019-06-04 17:03:28 +0200
commitf00210f9a45e950fe256bd44cca7bc80600c6684 (patch)
treea9bbc60fbd2d73ea419bce9aace8b63cd903b0d7 /emacs
parent535e13930d81db17e5afe06b85142c5d97bc5df9 (diff)
downloaddotfiles-f00210f9a45e950fe256bd44cca7bc80600c6684.tar.gz
dotfiles-f00210f9a45e950fe256bd44cca7bc80600c6684.zip
emacs: added python environment
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom.el2
-rw-r--r--emacs/init.org23
2 files changed, 24 insertions, 1 deletions
diff --git a/emacs/custom.el b/emacs/custom.el
index 1d62472..2a7d12e 100644
--- a/emacs/custom.el
+++ b/emacs/custom.el
@@ -15,7 +15,7 @@
'(markdown-command "/usr/bin/markdown-calibre")
'(package-selected-packages
(quote
- (inf-ruby move-text git-timemachine debbugs async-await request emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag))))
+ (py-autopep8 elpy inf-ruby move-text git-timemachine debbugs async-await request emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
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.