-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs.react.el
63 lines (48 loc) · 1.85 KB
/
.emacs.react.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
;; JS+React config. Supposed to be used with ~/.emacs.d.react directory as home.
;;
;; First time use:
;; * Install the "all-the-icons" set for neo-tree: `M-x all-the-icons-install-fonts` and then run `fc-cache -f -v` in the system.
;; Load the common configs
(load "~/.emacs.base.el")
;; Original guide in https://emacs-lsp.github.io/lsp-mode/tutorials/reactjs-tutorial/
(use-package lsp-mode
:hook ((js-mode js-jsx-mode js-ts-mode js-json-mode js-base-mode) . lsp)
:bind (:map lsp-mode-map
("M-?" . lsp-find-references)
("C-c C-c l" . flycheck-list-errors)
("C-c C-c C-n" . flycheck-next-error)
("C-c C-c C-p" . flycheck-previous-error)
("C-c C-c a" . lsp-execute-code-action)
("C-c C-c r" . lsp-rename)
("C-c C-c q" . lsp-workspace-restart)
("C-c C-c Q" . lsp-workspace-shutdown)
("C-c C-c h" . lsp-ui-doc-glance))
:config
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
:custom
;; See: https://emacs-lsp.github.io/lsp-mode/page/performance/
(read-process-output-max 8192)
(gc-cons-threshold 100000000)
(create-lockfiles nil)) ;; lock files will kill `npm start'
(use-package lsp-treemacs)
(use-package neotree
:bind ([f8] . neotree-toggle))
(use-package all-the-icons
:if (display-graphic-p)
:custom (neo-theme 'icons))
(use-package helm)
(use-package helm-lsp)
(use-package helm-xref)
(use-package projectile)
(use-package company
:bind (([remap list-buffers] . #'helm-buffers-list)
([remap execute-extended-command] . #'helm-M-x)
([switch-to-buffer] . #'helm-mini))
:custom
(company-idle-delay 0.0)
(company-minimum-prefix-length 1))
(use-package flycheck)
(use-package dockerfile-mode)
(use-package json-mode)
(with-eval-after-load 'js
(define-key js-mode-map (kbd "M-.") nil))