-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
102 lines (94 loc) · 2.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
94
95
96
97
98
99
100
101
102
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(url-retrieve
"https://github.com/dimitri/el-get/raw/master/el-get-install.el"
(lambda (s) (end-of-buffer) (eval-print-last-sexp))))
(setq
el-get-sources
'(el-get
(:name smex
:after (progn ;; 這邊就是對套件進行載入後設定,以及撰寫 recipe
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands))
)
(:name magit
:after (global-set-key (kbd "C-x C-z") 'magit-status)
)
(:name jedi
:after (progn
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
)
)
(:name neotree
:after (global-set-key [f8] 'neotree-toggle)
)
(:name android-mode
:after (custom-set-variables
'(android-mode-sdk-dir
"/usr/local/src/android-sdk-linux")
)
)
(:name evil
:type github
:pkgname "emacsmirror/evil"
)
(:name emmet-mode
:after (progn
(add-hook 'web-mode-hook 'emmet-mode)
(add-hook 'php-mode-hook 'emmet-mode)
)
)
(:name irony-mode
:after (progn
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
;; replace the `completion-at-point' and `complete-symbol' bindings in
;; irony-mode's buffers by irony-mode's function
(defun my-irony-mode-hook ()
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
)
)
(:name ac-irony
:after (progn
(defun my-ac-irony-setup ()
;; be cautious, if yas is not enabled before (auto-complete-mode 1), overlays
;; *may* persist after an expansion.
;; (yas-minor-mode 1)
(auto-complete-mode 1)
(add-to-list 'ac-sources 'ac-source-irony)
(define-key irony-mode-map (kbd "M-RET") 'ac-complete-irony-async))
(add-hook 'irony-mode-hook 'my-ac-irony-setup)
)
)
))
;; 設定要安裝的包!這裡是重點,下面解釋:
(setq packages
(append
'(el-get smex magit web-mode tomorrow-theme
jedi android-mode neotree
tabbar php-mode evil emmet-mode
irony-mode ac-irony
)
(mapcar 'el-get-source-name el-get-sources)))
;; 這裡是設定重點,包含異步/同步啟動機制
(el-get 'sync packages)
;; theme
(load-theme 'tomorrow-night t)
;; fonts
(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono Book" ))
(set-face-attribute 'default t :font "DejaVu Sans Mono Book" )
;; disable menu tool scroll bar
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode 1)
(speedbar 1)
;; evil-mode enable
(evil-mode 1)