-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
183 lines (144 loc) · 5.64 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
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
;;; package --- Summary
;;; Commentary:
;;; For installing MELPA.
(require 'package)
;;; Code:
(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."))
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need nor want to do this.
;;(and-to-list `package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
)
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode nil)
'(display-time-24hr-format nil)
'(display-time-day-and-date nil)
'(display-time-default-load-average nil)
'(display-time-mail-face nil)
'(display-time-mode nil)
'(org-link-beautify-mode t)
'(package-selected-packages
'(go-mode slime multiple-cursors atom-one-dark-theme exec-path-from-shell yasnippet lsp-ui rainbow-delimiters smartparens company lsp-docker flycheck fly-check use-package solarized-theme))
'(spaceline-all-the-icons-clock-always-visible nil)
'(spaceline-all-the-icons-eyebrowse-display-name nil)
'(spaceline-all-the-icons-flycheck-alternate nil)
'(spaceline-all-the-icons-highlight-file-name t)
'(spaceline-all-the-icons-icon-set-git-ahead 'commit)
'(spaceline-all-the-icons-icon-set-modified 'toggle)
'(spaceline-all-the-icons-icon-set-window-numbering 'solid)
'(spaceline-all-the-icons-separator-type 'arrow)
'(spaceline-all-the-icons-slim-render t)
'(spaceline-all-the-icons-window-number-always-visible t)
'(user-mail-address "[email protected]"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(lsp-ui-doc-background ((t (:background nil))))
'(lsp-ui-doc-header ((t (:inherit (font-lock-string-face italic))))))
;; Enable SLIME for Quicklisp
(load (expand-file-name "~/.quicklisp/slime-helper.el"))
(setq inferior-lisp-program "/usr/local/bin/sbcl")
;;; Install `flycheck`
(package-install 'flycheck)
(global-flycheck-mode)
;; required for flycheck on MacOS
(package-install 'exec-path-from-shell)
(exec-path-from-shell-initialize)
;; To provide simple syntax to declare and configure packages in your init file
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
;; Package to enable multi-cursor on-click
(use-package multiple-cursors
:ensure t
:bind (("M-." . mc/mark-next-like-this)
("M-," . mc/unmark-next-like-this)
("<s-mouse-1>" . mc/add-cursor-on-click)))
;; Keeping parentheses balanced
(use-package smartparens
:config
(add-hook 'prog-mode-hook 'smartparens-mode))
;; Highlight parens etc. for improved readability
(use-package rainbow-delimiters
:config
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode))
;; JavaScript
(setq-default js-indent-level 2)
;;; lsp-mode -- for the n'th time...
;;; "`(use-package foo)` is a macro call that expands to `(require 'foo)`
;;; plus some house-keeping like reporting long load times."
;;;
;;; Following lsp-mode code taken from:
;;; https://github.com/MatthewZMD/.emacs.d#lsp
(use-package lsp-mode
:defer t
:commands lsp
:custom
(lsp-auto-guess-root nil)
(lsp-prefer-flymake nil) ; Use flycheck instead of flymake
(lsp-file-watch-threshold 2000)
(read-process-output-max (* 1024 1024))
(lsp-eldec-hook nil)
:bind (:map lsp-mode-map ("C-c C-f" . lsp-format-buffer))
:hook ((js-mode) . lsp))
(use-package lsp-ui
:after lsp-mode
:diminish
:commands lsp-ui-mode
:custom-face
(lsp-ui-doc-background ((t (:background nil))))
(lsp-ui-doc-header ((t (:inherit (font-lock-string-face italic)))))
:bind
(:map lsp-ui-mode-map
([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
([remap xref-find-references] . lsp-ui-peek-find-references)
("C-c u" . lsp-ui-imenu)
("M-i" . lsp-ui-doc-focus-frame))
(:map lsp-mode-map
("M-n" . forward-paragraph)
("M-p" . backward-paragraph))
:custom
(lsp-ui-doc-header t)
(lsp-ui-doc-include-signature t)
(lsp-ui-doc-border (face-foreground 'default))
(lsp-ui-sideline-enable nil)
(lsp-ui-sideline-ignore-duplicate t)
(lsp-ui-sideline-show-code-actions nil)
:config
;; Use lsp-ui-doc-webkit only in GUI
(if (display-graphic-p)
(setq lsp-ui-doc-use-webkit t))
;; WORKAROUND Hide mode-line of the lsp-ui-imenu buffer
;; https://github.com/emacs-lsp/lsp-ui/issues/243
(defadvice lsp-ui-imenu (after hide-lsp-ui-imenu-mode-line activate)
(setq mode-line-format nil)))
(use-package company-lsp
:defer t
:custom (company-lsp-cache-candidates 'auto))
;;; Personals:
;; Remove default top-nav toolbar
(tool-bar-mode -1)
;; Normal erase for backspace key is opposite of default
(normal-erase-is-backspace-mode 1)
;; Load Emacs theme
(load-theme 'atom-one-dark t)
;; Initialize line-spacing
(setq-default line-spacing 0.3)
;; Initialize font style and size
(set-face-attribute 'default nil :height 145)
;;; init.el ends here