-
-
Notifications
You must be signed in to change notification settings - Fork 24
Home
MiniApollo edited this page Jan 19, 2024
·
4 revisions
Welcome to the kickstart.emacs wiki!
This wiki features additional information for alternative packages.
One alternative to Eglot is Lsp-mode.
Which is prettier, has more features, supports automatic language server installation, but is slower and more bloated.
If you want to use Lsp-mode don't forget to disable unnecessary features.
Example how to setup
My recommendation is Eglot!
(use-package lsp-mode
:custom
(lsp-completion-provider :none) ;; we use Corfu!
:init
(defun my/lsp-mode-setup-completion ()
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
'(flex))) ;; Configure flex (corfu)
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-c l")
;; To Disable features https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/
:hook (;; Automatic Language Modes
(prog-mode . lsp)
;; Which-key integration
(lsp-mode . lsp-enable-which-key-integration)
;; Corfu
(lsp-completion-mode . my/lsp-mode-setup-completion))
:commands lsp)
;; optionally
(use-package lsp-ui
:commands lsp-ui-mode)
;; if you are ivy user
(use-package lsp-ivy :commands lsp-ivy-workspace-symbol) (use-package lsp-mode
:custom
(lsp-completion-provider :none) ;; we use Corfu!
:init
(defun my/lsp-mode-setup-completion ()
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
'(flex))) ;; Configure flex (corfu)
:init
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-c l")
;; Disable unneeded features
(setq lsp-lens-enable nil) ;; Disable references count
(setq lsp-headerline-breadcrumb-enable nil) ;; Disable Header line
(setq lsp-ui-sideline-show-code-actions nil) ;; Hide right side code actions
(setq lsp-ui-sideline-show-hover nil) ;; Hide right hover symbols
(setq lsp-modeline-code-actions-enable nil) ;; Disable modeline code actions
(setq lsp-eldoc-enable-hover nil) ;; Disable eldoc (echo area info)
(setq lsp-modeline-diagnostics-enable nil) ;; Disable Modeline diagnostic status
(setq lsp-signature-auto-activate nil) ;; Disable Signature help you could manually request them via `lsp-signature-activate`
(setq lsp-completion-show-detail nil) ;; Disable Completion item detail
:hook (;; Automatic Language Modes
(prog-mode . lsp)
(lsp-completion-mode . my/lsp-mode-setup-completion) ;; corfu completion
;; if you want which-key integration
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp)
;; optionally
(use-package lsp-ui
:commands lsp-ui-mode)
;; if you are ivy user
(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
Modern on-the-fly syntax checking extension. Recommended for lsp-mode.
(use-package flycheck
:diminish
:init (global-flycheck-mode))