-
Notifications
You must be signed in to change notification settings - Fork 14
/
init.el
93 lines (69 loc) · 1.89 KB
/
init.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
;;; init-new.el --- Sample Emacs configuration for Python and github
;;; Commentary:
;;
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(defun install-if-needed (package)
(unless (package-installed-p package)
(package-install package)))
(setq my-packages
'(;; generally useful packages
company
company-jedi
rainbow-mode
rainbow-delimiters
smartparens
showkey
;; git/github
magit
magithub
;; python related packages
jedi
pytest
;; themes
noctilux-theme
dracula-theme
yasnippet))
(mapc 'install-if-needed my-packages)
(showkey-log-mode t)
;; show the function you are in
(which-function-mode t)
;; company is the completion backend
(global-company-mode t)
;; nicer parenthesis handling
(smartparens-global-mode t)
;; show the parens
(show-paren-mode t)
;; show column number
(column-number-mode t)
;; show line number
(global-linum-mode t)
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook #'rainbow-mode)
(yas-global-mode t)
;; python specific stuff
(require 'company-jedi)
;; various settings for Jedi
(setq
jedi:complete-on-dot t
jedi:setup-keys t
py-electric-colon-active t
py-smart-indentation t)
(venv-workon "emacs-demo")
(add-hook 'python-mode-hook
(lambda ()
(add-to-list 'company-backends 'company-jedi)
(hack-local-variables)
(jedi:setup)
(local-set-key "\C-cd" 'jedi:show-doc)
(local-set-key (kbd "M-.") 'jedi:goto-definition)
(local-set-key (kbd "M-D") 'ca-python-remove-pdb)
(local-set-key [f6] 'pytest-module)))
(load-library "magit")
;; (load-library "magithub")
;; (magithub-feature-autoinject t)
(global-set-key "\C-xg" 'magit-status)
(load-theme 'noctilux)
(provide 'init-new)
;;; init-new.el ends here