aboutsummaryrefslogtreecommitdiffstats
path: root/modules/init-python.el
blob: b2800d6b188e404f7e700cae4d3ecbb16f907579 (plain)
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
;;; init-python.el --- .Emacs Configuration -*- lexical-binding: t -*-
;;; Commentary:
;;

;;; Code:
;;----------------------------------------------------------------------------
;; Python Mode
;;----------------------------------------------------------------------------
(add-hook 'python-mode-hook
          (lambda ()
            (setq indent-tabs-mode nil)
            (setq python-indent-guess-indent-offset nil)
            (setq python-indent-offset 4)))

(use-package python
  :mode
  ("\\.py" . python-mode))

(use-package elpy
  :init
  (advice-add 'python-mode :before 'elpy-enable)
  :mode
  ("\\.py$" . python-mode)
  :config
  (setq elpy-rpc-backend "jedi")
  :bind
  (:map elpy-mode-map
        ("M-." . elpy-goto-definition)
        ("M-," . pop-tag-mark)))

(setq auto-mode-alist
      (append '(("SConstruct\\'" . python-mode)
                ("SConscript\\'" . python-mode))
              auto-mode-alist))

(use-package pip-requirements
  :hook
  (pip-requirements-mode-hook . pip-requirements-auto-complete-setup))

(use-package py-autopep8)

(use-package pyvenv)

(provide 'init-python)

;; Local Variables:
;; byte-compile-warnings: (not free-vars)
;; End:
;;; init-python.el ends here