Replace lsp-mode with eglot
This commit is contained in:
parent
db8e54d545
commit
4cf5f8c3b1
79
init.el
79
init.el
|
@ -299,43 +299,25 @@
|
|||
:config
|
||||
(which-key-mode))
|
||||
|
||||
(use-package lsp-mode
|
||||
(use-package eglot
|
||||
:demand nil
|
||||
:hook
|
||||
(c-ts-mode . lsp-deferred)
|
||||
(c++-ts-mode . lsp-deferred)
|
||||
(html-mode . lsp-deferred)
|
||||
(lsp-mode . lsp-enable-which-key-integration)
|
||||
(c-mode . eglot-ensure)
|
||||
(c-ts-mode . eglot-ensure)
|
||||
(c++-mode . eglot-ensure)
|
||||
(c++-ts-mode . eglot-ensure)
|
||||
(java-mode . eglot-ensure)
|
||||
(java-ts-mode . eglot-ensure)
|
||||
:custom
|
||||
(read-process-output-max (* 1024 1024)) ; 1 MB
|
||||
(lsp-keymap-prefix "M-o"))
|
||||
|
||||
(use-package lsp-java
|
||||
:hook
|
||||
(java-ts-mode . lsp-deferred))
|
||||
|
||||
(use-package lsp-ui)
|
||||
(use-package lsp-treemacs
|
||||
:hook
|
||||
(lsp-mode . lsp-treemacs-sync-mode))
|
||||
|
||||
(use-package dap-mode
|
||||
:bind (:map lsp-command-map ("d" . dap-hydra))
|
||||
:custom
|
||||
(dap-auto-configure-mode t)
|
||||
(dap-auto-configure-features '(sessions locals breakpoints expressions tooltip))
|
||||
(eglot-events-buffer-size 0)
|
||||
(eglot-autoshutdown t)
|
||||
:config
|
||||
(add-hook 'dap-stopped-hook (lambda (arg) (call-interactively #'dap-hydra)))
|
||||
(require 'dap-cpptools)
|
||||
(dap-register-debug-template
|
||||
"Automatic C++ debug"
|
||||
(list :type "cppdbg"
|
||||
:request "launch"
|
||||
:name "Automatic C++ debug"
|
||||
:MIMode "gdb"
|
||||
:dap-compilation "CXXFLAGS='-g' make '${fileBasenameNoExtension}'"
|
||||
:program "${workspaceFolder}/${fileBasenameNoExtension}"
|
||||
:cwd "${workspaceFolder}"
|
||||
:args ["<" "${workspaceFolder}/${fileBasenameNoExtension}.in"])))
|
||||
(add-hook 'eglot-managed-mode-hook
|
||||
(lambda ()
|
||||
(setq-local indent-region-function #'eglot-format))))
|
||||
|
||||
(use-package eglot-java
|
||||
:hook java-mode java-ts-mode)
|
||||
|
||||
(use-package yasnippet
|
||||
:config
|
||||
|
@ -473,7 +455,9 @@
|
|||
(org-preview-latex-default-process 'dvisvgm)
|
||||
:config
|
||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1))
|
||||
(add-to-list 'org-modules 'org-tempo))
|
||||
(add-to-list 'org-modules 'org-tempo)
|
||||
(with-eval-after-load 'catppuccin-theme
|
||||
(face-spec-set 'org-block `((t (:foreground ,(catppuccin-get-color 'text)))))))
|
||||
|
||||
(use-package org-modern
|
||||
:hook
|
||||
|
@ -522,8 +506,27 @@
|
|||
|
||||
(use-package meson-mode)
|
||||
|
||||
(defun my-org-spell-fu-faces-exclude ()
|
||||
(setq spell-fu-faces-exclude
|
||||
'(org-block-begin-line
|
||||
org-block-end-line
|
||||
org-code
|
||||
org-date
|
||||
org-drawer org-document-info-keyword
|
||||
org-ellipsis
|
||||
org-link
|
||||
org-meta-line
|
||||
org-properties
|
||||
org-properties-value
|
||||
org-special-keyword
|
||||
org-src
|
||||
org-tag
|
||||
org-verbatim)))
|
||||
|
||||
(use-package spell-fu
|
||||
:hook org-mode text-mode)
|
||||
:hook
|
||||
text-mode
|
||||
(org-mode . my-org-spell-fu-faces-exclude))
|
||||
|
||||
(use-package minimap
|
||||
:custom-face
|
||||
|
@ -831,9 +834,7 @@
|
|||
"Simply enables relative line numbers."
|
||||
(setq display-line-numbers 'relative))
|
||||
(dolist (hook '(prog-mode-hook
|
||||
text-mode-hook
|
||||
conf-mode-hook
|
||||
org-mode-hook))
|
||||
conf-mode-hook))
|
||||
(add-hook hook #'my-relative-linenum))
|
||||
|
||||
(defun my-use-spaces-for-indent ()
|
||||
|
|
Loading…
Reference in a new issue