-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackages.el
218 lines (208 loc) · 6.25 KB
/
packages.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
;;; packages.el --- Melpa packages -*- lexical-binding: t; coding: utf-8 -*-
;; Copyright (C) 2013-2020 gniuk <[email protected]>
;;; Commentary:
;; none
;;; Code:
(require 'package)
(setq-default package-check-signature nil) ; failed to verify signature auctex
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
;; (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;; (add-to-list 'package-archives (cons "melpa" (concat proto "://elpa.emacs-china.org/melpa/")) t)
(setq package-archives `(("gnu" . ,(concat proto "://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/"))
("melpa" . ,(concat proto "://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/"))
("org" . ,(concat proto "://mirrors.tuna.tsinghua.edu.cn/elpa/org/"))))
(when (< emacs-major-version 24)
;;; For important compatibility libraries like cl-lib
;; (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
;; (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.emacs-china.org/gnu/")))
(setq package-archives `(("gnu" . ,(concat proto "://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/"))))))
(package-initialize)
(defvar required-packages
'(
paradox
company
;company-c-headers
company-anaconda
yasnippet
yasnippet-snippets
;autopair ; replaced by smartparens
;paredit ; replaced by smartparens
switch-window
expand-region
;hl-line
helm
;helm-gtags ; rarely used now but maybe useful in some bare place
js2-mode
graphviz-dot-mode
goto-last-change
nasm-mode
undo-tree
;tern
;company-tern
rainbow-delimiters
;rainbow-identifiers ; use color-identifiers-mode instead
;auto-highlight-symbol
;smartscan ; symbol_with_underscore not recognized. using highlight-symbol to navigate
;ace-jump-mode
;fill-column-indicator
;col-highlight ; not in melpa now, put it in nonmelpa
;company-ycmd
flycheck
helm-flycheck
;; irony
;; company-irony
;; company-irony-c-headers
;; irony-eldoc
;; flycheck-irony
;; helm-rtags ; Long time not used, mark irony+rtags as a stand-by. Uncomment and call use-rtags to use them.
;projectile ; as a requirement of helm-projectile
helm-projectile
;; color-theme-sanityinc-solarized
;; color-theme-sanityinc-tomorrow
;; afternoon-theme ; mark the ex color theme
magit
cmake-mode
eldoc-cmake
web-mode
company-web
web-beautify
helm-css-scss
css-eldoc
emmet-mode
helm-emmet
;guide-key ; replaced by which-key
helm-c-yasnippet
multiple-cursors
ace-jump-buffer
quickrun
hlinum ;; replace hl-line
;smooth-scrolling ;; makes emacs laggy, just tuning the builtin scroll settings
readline-complete
;dired+ ; no more dired+ in melpa, use plain builtin dired, or just neotree is enough
;neotree ; replaced by treemacs
;indent-guide ; interfere company popup window, use highlight-indent-guides instead
window-numbering
anzu
buffer-move
mwim
;codesearch
;projectile-codesearch ;; mark it
helm-swoop
ace-jump-zap
ace-pinyin
company-auctex
shell-pop
;helm-company
popwin
youdao-dictionary
color-identifiers-mode
chinese-yasdcv
helm-ag
;; helm-rg ; now use rg with helm-ag, helm-rg seems no need.
;god-mode
which-key
;workgroups2
;ace-isearch
;highlight-symbol
highlight-indent-guides
company-shell
pcmpl-args
go-mode
company-go
go-eldoc
gotest
go-playground
markdown-mode
flymd
pandoc-mode
doom-modeline
;; doom-themes
evil
evil-matchit
vterm
golden-ratio
disaster
spacemacs-theme
pyim
;rime ;; mark
;; company-statistics ; seems no need?
x86-lookup
org-bullets
symbol-overlay
vc-msg
smartparens
git-timemachine
eyebrowse
dumb-jump
htmlize
ccls
;company-lsp ; use company-capf instead
helm-lsp
helm-xref
lsp-ui
dtrt-indent
realgud
cheat-sh
treemacs ; replace neotree
avy
ascii-table
nov
tiny
restclient
restclient-helm
iasm-mode
rfc-mode
;evil-escape ; my Ctrl key is convenient :)
;evil-vimish-fold ; overrides evil default fold, not good
vimish-fold
;; git-gutter ; orphan
diff-hl
;vdiff-magit ; patience is not good as expected, ediff is enough, beyond compare is the goal
ranger
ztree
;zygospore ; not that useful
rainbow-mode
counsel ; insert-char of emacs-28.0.50 is not working with helm, thus give counsel a try
fanyi
lsp-dart
lsp-treemacs
yaml-mode
pipenv
;; helm-dogears ;; requires dogears by defalut
;fast-scroll
;; lsp-jedi ; mark python lsp server, if anaconda-mode not usable any more, use this.
lsp-pyright
exec-path-from-shell
;; rg ; helm-ag is good enough
;; company-restclient ; mark
;; org-brain ; mark
;; benchmark-init
) "A list of packages to ensure that they have been installed.")
(require 'cl-lib)
(cl-defun packages-installed-p ()
"Method to check if all packages are installed."
(cl-loop for p in required-packages
when (not (package-installed-p p)) do (cl-return nil)
finally (cl-return t)))
; if not all packages are installed, check one by one and install the missing ones.
(unless (packages-installed-p)
; check for new packages (package versions)
(message "%s" "Emacs is now refreshing its package database...")
(package-refresh-contents)
(message "%s" " done.")
; install the missing packages
(cl-dolist (p required-packages)
(when (not (package-installed-p p))
(package-install p))))
(provide 'packages)
;;; packages.el ends here