blob: cbce25809691ff02c081cbe73b189f03072c1a5a (
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
|
;;; 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)))
;;----------------------------------------------------------------------------
;; Jedi - Python auto-completion for Emacs
;;----------------------------------------------------------------------------
(use-package jedi)
(setq auto-mode-alist
(append '(("SConstruct\\'" . python-mode)
("SConscript\\'" . python-mode))
auto-mode-alist))
(use-package pip-requirements)
(defun my/python-mode-stuff ()
"Jedi make everything a lot easier for everybody!.
It's helps prepare jedi in Emacs."
(jedi:setup)
(define-key python-mode-map (kbd "C-]") 'jedi:goto-definition) ;goto define
(local-set-key (kbd "<f1>") 'jedi:show-doc)
(setq jedi:complete-on-dot t) ; optional
)
;; Added Jedi-mode to python-mode
(add-hook 'python-mode-hook 'my/python-mode-stuff)
;; M-x jedi:install-server
(provide 'init-python)
;; Local Variables:
;; byte-compile-warnings: (not free-vars)
;; End:
;;; init-python.el ends here
|