From ace191d0d6b7c21d32abb42748149b6c085a2e07 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Tue, 17 Dec 2019 13:10:04 +0100 Subject: [PATCH] Regroup Python configuration --- init.el | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/init.el b/init.el index 106d787..4beb956 100644 --- a/init.el +++ b/init.el @@ -2549,15 +2549,37 @@ With given ARG, display files in `db/important-document-path’." :commands (helm-bibtex)) -;; * Various Mode Configurations - -;; These are packages that are not essential, but still nice to have. They -;; provide optional functionality and may redefine builtin commands. +;; * Python (use-package company-jedi :ensure t :defer t) +(use-package python + :defer t + :init (setq python-indent-offset 2) + :config (progn + (add-hook 'python-mode-hook 'highlight-indentation-mode) + (add-hook 'python-mode-hook + #'(lambda () + (add-to-list 'company-backends 'company-jedi))) + + ;; Somehow, `eldoc' seems to be broken in `python-mode', disable it + ;; for now. + (add-hook 'python-mode-hook #'(lambda () (eldoc-mode -1))) + + (elpy-enable))) + +(use-package elpy + :ensure t + :commands (elpy-enable)) + + +;; * Various Mode Configurations + +;; These are packages that are not essential, but still nice to have. They +;; provide optional functionality and may redefine builtin commands. + (use-package cperl-mode :ensure t :commands (cperl-mode) @@ -2608,10 +2630,6 @@ With given ARG, display files in `db/important-document-path’." (add-to-list 'electric-pair-pairs '(?„ . ?“)) (add-to-list 'electric-pair-text-pairs '(?„ . ?“)))) -(use-package elpy - :ensure t - :commands (elpy-enable)) - (use-package eproject :defer t :config (progn @@ -2715,16 +2733,6 @@ With given ARG, display files in `db/important-document-path’." (use-package pdf-tools :commands (pdf-tools-install)) -(use-package python - :defer t - :init (setq python-indent-offset 2) - :config (progn - (add-hook 'python-mode-hook 'highlight-indentation-mode) - (add-hook 'python-mode-hook #'(lambda () (eldoc-mode -1))) - (add-hook 'python-mode-hook #'(lambda () - (add-to-list 'company-backends 'company-jedi))) - (elpy-enable))) - ;; Interactive interface to sdcv, the StarDict concole version. To use sdcv, ;; put the dictionary data under ~/.stardict/dic. (use-package sdcv