Optimize lsp-mode

This commit is contained in:
Jeremy Dormitzer 2020-05-22 18:10:12 -04:00
parent fdab7ba8e5
commit 08c88cbe9f

View File

@ -25,7 +25,7 @@ Turn off GC during init and restore it afterwards:
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold 16777216
(setq gc-cons-threshold 100000000
gc-cons-percentage 0.1)))
#+END_SRC
@ -36,7 +36,7 @@ Also suppress GC for 1 second after the minibuffer is active to avoid stuttering
(defun restore-garbage-collection ()
(run-at-time
1 nil (lambda () (setq gc-cons-threshold 16777216))))
1 nil (lambda () (setq gc-cons-threshold 100000000))))
(add-hook 'minibuffer-setup-hook #'defer-garbage-collection)
(add-hook 'minibuffer-exit-hook #'restore-garbage-collection)
@ -57,7 +57,8 @@ Another optimization from [[https://github.com/hlissner/doom-emacs/blob/develop/
(setq vc-follow-symlinks t
frame-resize-pixelwise t
tab-always-indent 'complete
enable-recursive-minibuffers t)
enable-recursive-minibuffers t
read-process-output-max (* 1024 1024))
(setq-default indent-tabs-mode nil)
#+END_SRC
@ -2868,9 +2869,17 @@ Emacs support for the Language Server Protocol
:general
(lsp-mode-map "C-c h" 'hydra-lsp/body)
((normal visual motion) lsp-mode-map "K" #'lsp-describe-thing-at-point)
((normal visual motion) "gl" lsp-command-map)
:hook
((lsp-mode . (lambda ()
(let ((lsp-keymap-prefix "gl"))
(lsp-enable-which-key-integration)))))
:config
(setq lsp-prefer-flymake nil)
:commands lsp-mode lsp lsp-deferred)
:commands lsp-mode lsp lsp-deferred
:custom
(lsp-enable-snippet nil)
(lsp-eldoc-render-all nil))
(use-package lsp-ui
:after (lsp-mode)
@ -2886,7 +2895,7 @@ Emacs support for the Language Server Protocol
(lsp-ui-doc-background '((t (:inherit region))))
(lsp-ui-doc-header '((t (:inherit lsp-face-highlight-write))))
(lsp-ui-sideline-current-symbol '((t (:inherit font-lock-constant-face
:weight ultra-bold)))))
:weight ultra-bold)))))
(with-eval-after-load 'lsp-clients
(defun lsp-typescript-javascript-tsx-jsx-activate-p (filename major-mode)