summary refs log tree commit diff
path: root/emacs/custom/my-lsp.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/custom/my-lsp.el')
-rw-r--r--emacs/custom/my-lsp.el41
1 files changed, 12 insertions, 29 deletions
diff --git a/emacs/custom/my-lsp.el b/emacs/custom/my-lsp.el
index c10e06c..40ba785 100644
--- a/emacs/custom/my-lsp.el
+++ b/emacs/custom/my-lsp.el
@@ -5,35 +5,18 @@
 
 ;;; Code:
 
-(require 'lsp-mode)
-(require 'lsp-ui)
-(require 'lsp-diagnostics)
-(require 'consult-lsp)
-(require 'lsp-completion)
-
-(setq lsp-ui-doc-enable                 t) ;; Enable documentation
-(setq lsp-ui-doc-position       'at-point) ;; Show the documentation at point
-(setq lsp-ui-doc-header                 t)
-(setq lsp-ui-doc-include-signature      t)
-(setq lsp-ui-peek-enable                t) ;; Enable `lsp-ui-peek'.
-(setq lsp-ui-peek-show-directory        t) ;; Show the directory of files.
-(setq lsp-ui-sideline-enable          nil) ;; Don't enable `lsp-ui-sideline'.
-
-(add-hook 'lsp-mode-hook #'lsp-ui-mode)
-
-;; Enable `completion-at-point' integration.
-(setq lsp-completion-enable t)
-
-;; The default is to use flycheck
-(setq lsp-diagnostics-provider :flymake)
-
-(define-key lsp-mode-map [remap xref-find-apropos] #'consult-lsp-symbols)
-
-;; Configure the completion to be corfu
-(setq lsp-completion-provider :none)
-(add-hook 'lsp-completion-mode-hook
-          (lambda ()
-	    (setf (alist-get 'lsp-capf completion-category-defaults) '((styles . (orderless flex))))))
+(require 'eglot)
+
+;; settings related to performance
+;; https://emacs-lsp.github.io/lsp-mode/page/performance/
+(setq read-process-output-max (* 1024 1024)) ;; 1mb
+(setq gc-cons-threshold 100000000)           ;; 100mb
+
+(global-set-key (kbd "C-c l e") #'eglot)
+(define-key eglot-mode-map (kbd "C-c l s") #'eglot-shutdown)
+(define-key eglot-mode-map (kbd "C-c l r") #'eglot-rename)
+(define-key eglot-mode-map (kbd "C-c l a") #'eglot-code-actions)
+(define-key eglot-mode-map (kbd "C-c l o") #'eglot-code-action-organize-imports)
 
 (provide 'my-lsp)