forked from AndreaCrotti/minimal-emacs-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
74 lines (57 loc) · 2.01 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
;; Requisites: Emacs >= 24
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-refresh-contents)
(defun install-if-needed (package)
(unless (package-installed-p package)
(package-install package)))
;; make more packages available with the package installer
(setq to-install
'(python-mode magit yasnippet jedi auto-complete autopair find-file-in-repository flycheck))
(mapc 'install-if-needed to-install)
(require 'magit)
(global-set-key "\C-xg" 'magit-status)
(require 'auto-complete)
(require 'autopair)
(require 'yasnippet)
(global-set-key [f7] 'find-file-in-repository)
; auto-complete mode extra settings
(setq
ac-auto-start 2
ac-override-local-map nil
ac-use-menu-map t
ac-candidate-limit 20)
;; ;; Python mode settings
(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
(setq py-electric-colon-active t)
(add-hook 'python-mode-hook 'autopair-mode)
(add-hook 'python-mode-hook 'yas-minor-mode)
;; ;; Jedi settings
(require 'jedi)
;; It's also required to run "pip install --user jedi" and "pip
;; install --user epc" to get the Python side of the library work
;; correctly.
;; With the same interpreter you're using.
;; if you need to change your python intepreter, if you want to change it
;; (setq jedi:server-command
;; '("python2" "/home/andrea/.emacs.d/elpa/jedi-0.1.2/jediepcserver.py"))
(add-hook 'python-mode-hook
(lambda ()
(jedi:setup)
(jedi:ac-setup)
(local-set-key "\C-cd" 'jedi:show-doc)
(local-set-key (kbd "M-SPC") 'jedi:complete)
(local-set-key (kbd "M-.") 'jedi:goto-definition)))
(add-hook 'python-mode-hook 'auto-complete-mode)
(ido-mode t)
;; -------------------- extra nice things --------------------
;; use shift to move around windows
(windmove-default-keybindings 'shift)
(show-paren-mode t)
; Turn beep off
(setq visible-bell nil)