-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-python.el
54 lines (49 loc) · 1.62 KB
/
my-python.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
;;; my-python --- Python configuration
;;
;; Copyright (C) 2014 Alex Bennée
;;
;; Author: Alex Bennée <[email protected]>
;;
;; This file is not part of GNU Emacs.
;;
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;;; Commentary:
;;
;; There are two python modes, one supplied with Emacs (python.el) and
;; a Python community one called python-mode.el. elpy works with the
;; Emacs version. Annoyingly both these modes clash so hi-jinks can
;; ensue when your not sure what you are running.
;;
;;; Code:
(require 'use-package)
(require 'my-flycheck)
(use-package python
:config
(setq python-shell-interpreter "python3"
python-shell-interpreter-args "-i"))
(use-package elpy
:disabled t
:commands elpy-enable
:after (python flycheck)
:init (elpy-enable)
:config
(setq elpy-rpc-backend "jedi"
elpy-rpc-project-specific 't
elpy-rpc-python-command "python3"
; work around native-compile bug
elpy-rpc-pythonpath (file-name-directory (locate-library "elpy.el" t))
elpy-rpc-virtualenv-path 'system
elpy-modules (delq 'elpy-module-flymake elpy-modules))
(eval-after-load 'flycheck-mode
(when (fboundp 'flycheck-tip-cycle)
(define-key elpy-mode-map (kbd "C-c C-n")
'flycheck-tip-cycle))))
;; elpy can be enabled better on demand surely?
;; TODO - automode alist
;;(add-hook 'python-mode-hook #'(lambda () (require 'my-python-mode)))
(provide 'my-python)
;;; my-python.el ends here