From 1263e29b8b957ab6a5caba210a9ad99356ae8a50 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 8 Dec 2019 21:51:17 +0100 Subject: [PATCH] Setup Python --- .gitignore | 2 ++ init.el | 15 +++++++++++++++ modules/jenga-python.el | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 modules/jenga-python.el diff --git a/.gitignore b/.gitignore index 5b2418f..4487cc9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ elpa/ transient/ history +ac-comphist.dat +elpy/ diff --git a/init.el b/init.el index 316ea6c..05a8dc9 100644 --- a/init.el +++ b/init.el @@ -16,9 +16,24 @@ (require 'jenga-helm) (require 'jenga-magit) (require 'jenga-org) +(require 'jenga-python) (require 'jenga-theme) ;; Custom languages and highlighting (require 'jenga-elm) (require 'jenga-rust) (require 'jenga-systemd) +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + (quote + (ein-mumamo yasnippet use-package racer material-theme magit lsp-ui helm flycheck-rust elm-mode company-lsp cargo)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/modules/jenga-python.el b/modules/jenga-python.el new file mode 100644 index 0000000..2083da3 --- /dev/null +++ b/modules/jenga-python.el @@ -0,0 +1,26 @@ +;;;; Python configuration. +(require 'jenga-functions) +(instl 'elpy) +(instl 'jupyter) +(instl 'ein) +(instl 'py-autopep8) +(instl 'yasnippet) + +(elpy-enable) + +(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save) + +;; Enable Flycheck +(when (require 'flycheck nil t) + (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) + (add-hook 'elpy-mode-hook 'flycheck-mode)) + +;; Use IPython for REPL +(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") + +(provide 'jenga-python)