This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
/
packages.el
55 lines (45 loc) · 1.47 KB
/
packages.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;;; packages.el --- elpy Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(add-to-list 'package-archives
'("elpy" . "http://jorgenschaefer.github.io/packages/"))
(setq elpy-packages
'(
company
elpy
flycheck
))
(setq elpy-excluded-packages '())
(defun elpy/init-elpy ()
(use-package elpy
:diminish elpy-mode
:config
;; Elpy removes the modeline lighters. Let's override this
(defun elpy-modules-remove-modeline-lighter (mode-name))
(setq elpy-modules '(elpy-module-sane-defaults
elpy-module-eldoc
elpy-module-pyvenv))
(when (configuration-layer/layer-usedp 'auto-completion)
(add-to-list 'elpy-modules 'elpy-module-company)
(add-to-list 'elpy-modules 'elpy-module-yasnippet))
(elpy-enable)
))
(defun elpy/post-init-company ()
(spacemacs|add-company-hook inferior-python-mode)
(push 'company-capf company-backends-inferior-python-mode)
(add-hook 'inferior-python-mode-hook
(lambda ()
(setq-local company-minimum-prefix-length 0)
(setq-local company-idle-delay 0.5)))
)
(defun elpy/post-init-flycheck ()
(add-hook 'elpy-mode-hook 'flycheck-mode)
)