;;; my-lsp.el --- Configures emacs for LSP -*- lexical-binding: t -*- ;; Author: Franck Cuny ;;; Commentary: ;;; 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)))))) (provide 'my-lsp) ;;; my-lsp.el ends here