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
|
:config
|
||||||
(which-key-mode))
|
(which-key-mode))
|
||||||
|
|
||||||
(use-package lsp-mode
|
(use-package eglot
|
||||||
|
:demand nil
|
||||||
:hook
|
:hook
|
||||||
(c-ts-mode . lsp-deferred)
|
(c-mode . eglot-ensure)
|
||||||
(c++-ts-mode . lsp-deferred)
|
(c-ts-mode . eglot-ensure)
|
||||||
(html-mode . lsp-deferred)
|
(c++-mode . eglot-ensure)
|
||||||
(lsp-mode . lsp-enable-which-key-integration)
|
(c++-ts-mode . eglot-ensure)
|
||||||
|
(java-mode . eglot-ensure)
|
||||||
|
(java-ts-mode . eglot-ensure)
|
||||||
:custom
|
:custom
|
||||||
(read-process-output-max (* 1024 1024)) ; 1 MB
|
(eglot-events-buffer-size 0)
|
||||||
(lsp-keymap-prefix "M-o"))
|
(eglot-autoshutdown t)
|
||||||
|
|
||||||
(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))
|
|
||||||
:config
|
:config
|
||||||
(add-hook 'dap-stopped-hook (lambda (arg) (call-interactively #'dap-hydra)))
|
(add-hook 'eglot-managed-mode-hook
|
||||||
(require 'dap-cpptools)
|
(lambda ()
|
||||||
(dap-register-debug-template
|
(setq-local indent-region-function #'eglot-format))))
|
||||||
"Automatic C++ debug"
|
|
||||||
(list :type "cppdbg"
|
(use-package eglot-java
|
||||||
:request "launch"
|
:hook java-mode java-ts-mode)
|
||||||
:name "Automatic C++ debug"
|
|
||||||
:MIMode "gdb"
|
|
||||||
:dap-compilation "CXXFLAGS='-g' make '${fileBasenameNoExtension}'"
|
|
||||||
:program "${workspaceFolder}/${fileBasenameNoExtension}"
|
|
||||||
:cwd "${workspaceFolder}"
|
|
||||||
:args ["<" "${workspaceFolder}/${fileBasenameNoExtension}.in"])))
|
|
||||||
|
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:config
|
:config
|
||||||
|
@ -473,7 +455,9 @@
|
||||||
(org-preview-latex-default-process 'dvisvgm)
|
(org-preview-latex-default-process 'dvisvgm)
|
||||||
:config
|
:config
|
||||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1))
|
(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
|
(use-package org-modern
|
||||||
:hook
|
:hook
|
||||||
|
@ -522,8 +506,27 @@
|
||||||
|
|
||||||
(use-package meson-mode)
|
(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
|
(use-package spell-fu
|
||||||
:hook org-mode text-mode)
|
:hook
|
||||||
|
text-mode
|
||||||
|
(org-mode . my-org-spell-fu-faces-exclude))
|
||||||
|
|
||||||
(use-package minimap
|
(use-package minimap
|
||||||
:custom-face
|
:custom-face
|
||||||
|
@ -831,9 +834,7 @@
|
||||||
"Simply enables relative line numbers."
|
"Simply enables relative line numbers."
|
||||||
(setq display-line-numbers 'relative))
|
(setq display-line-numbers 'relative))
|
||||||
(dolist (hook '(prog-mode-hook
|
(dolist (hook '(prog-mode-hook
|
||||||
text-mode-hook
|
conf-mode-hook))
|
||||||
conf-mode-hook
|
|
||||||
org-mode-hook))
|
|
||||||
(add-hook hook #'my-relative-linenum))
|
(add-hook hook #'my-relative-linenum))
|
||||||
|
|
||||||
(defun my-use-spaces-for-indent ()
|
(defun my-use-spaces-for-indent ()
|
||||||
|
|
Loading…
Reference in a new issue