emacs.d

My emacs configuration, done in a literate programming fashion using org-mode

git clone git://git.shimmy1996.com/emacs.d.git
commit f36e365509b1f381688a4bdeaffd7091daf27e37
parent dc093d35b6cf967db6199ad51c8bb673648a1ace
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Mon,  9 Jul 2018 16:47:15 -0400

Add settings for python-mode.

Diffstat:
MREADME.org | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+), 0 deletions(-)
diff --git a/README.org b/README.org
@@ -537,6 +537,15 @@ Enable math symbol backend only in =TeX-mode=.
   (add-hook 'TeX-mode-hook 'company-math-init)
 #+END_SRC
 
+**** =company-anaconda=
+Install =company-anaconda= and add it to =company-backends=.
+#+BEGIN_SRC emacs-lisp
+  (use-package company-anaconda
+    :ensure t
+    :init (add-to-list 'company-backends
+                       'company-anaconda))
+#+END_SRC
+
 **** =company-auctex=
 Install =company-auctex= and add it to =company-backends=. This is for =acutex= macro completion.
 Adding backends is handled by =company-auctex-init=.
@@ -864,6 +873,66 @@ Wrap key bindings in =<kbd>=.
   (setq org-hugo-use-code-for-kbd t)
 #+END_SRC
 
+** Python-mode
+Enhancements to =python-mode=.
+
+*** Anaconda Mode
+Code navigation, documentation lookup and completion for Python.
+#+BEGIN_SRC emacs-lisp
+  (use-package anaconda-mode
+    :ensure t
+    :init
+    (add-hook 'python-mode-hook 'anaconda-mode)
+    (add-hook 'python-mode-hook 'anaconda-eldoc-mode))
+#+END_SRC
+
+*** Auto Format
+**** yapf
+Use =yapf= to auto format python buffers on save.
+#+BEGIN_SRC emacs-lisp
+  (use-package yapfify
+    :ensure t
+    :init
+    (add-hook 'python-mode-hook 'yapf-mode))
+#+END_SRC
+
+**** DISABLED pep8
+Use =py-autopep8= to auto format python buffers on save.
+#+BEGIN_SRC emacs-lisp
+  (use-package py-autopep8
+    :ensure t
+    :init
+    (add-hook 'python-mode-hook 'py-autopep8-enable-on-save))
+#+END_SRC
+
+*** Syntax Checking
+**** Flycheck
+By default =flycheck= only runs one available python checker.
+#+BEGIN_SRC emacs-lisp
+  (flycheck-add-next-checker 'python-flake8 'python-pylint)
+#+END_SRC
+
+**** DISABLED pycheckers
+By default =flycheck= only runs one available python checker. Use
+=flycheck-pycheckers=.
+#+BEGIN_SRC emacs-lisp
+  (use-package flycheck-pycheckers
+    :ensure t
+    :init
+    (setq flycheck-pycheckers-checkers '(pylint flake8))
+    (add-hook 'flycheck-mode-hook #'flycheck-pycheckers-setup))
+#+END_SRC
+
+*** Python Interpretor
+Use Jupyter console as default interpreter.
+#+BEGIN_SRC emacs-lisp
+  (setq python-shell-interpreter "jupyter"
+        python-shell-interpreter-args "console --simple-prompt"
+        python-shell-prompt-detect-failure-warning nil)
+  (add-to-list 'python-shell-completion-native-disabled-interpreters
+               "jupyter")
+#+END_SRC
+
 ** Rust-mode
 A compilation of settings for programming in rust. The recommended way to
 install rust is via =rustup=. Remember to use =rustup add component= to install