This commit is contained in:
Mars 2024-10-13 19:52:09 -04:00
parent 983077017a
commit 59f4251ed8
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5

View file

@ -262,88 +262,93 @@
*** Eglot *** Eglot
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package markdown-mode (use-package markdown-mode
:ensure t :ensure t
:mode ("README\\.md\\'" . gfm-mode) :mode ("README\\.md\\'" . gfm-mode)
:init (setq markdown-command "multimarkdown") :init (setq markdown-command "multimarkdown")
:bind (:map markdown-mode-map :bind (:map markdown-mode-map
("C-c C-e" . markdown-do))) ("C-c C-e" . markdown-do)))
(use-package eglot-booster (use-package eglot-booster
:after eglot :after eglot
:ensure (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster") :ensure (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster")
:config (eglot-booster-mode)) :config (eglot-booster-mode))
(use-package eglot (use-package eglot
:ensure nil :ensure nil
:config :config
(defun my-eglot-rename (newname) (defun my-eglot-rename (newname)
"Rename the current symbol to NEWNAME with initial input a." "Rename the current symbol to NEWNAME with initial input a."
(interactive (interactive
(list (read-from-minibuffer (list (read-from-minibuffer
(format "Rename `%s' to: " (or (thing-at-point 'symbol t) (format "Rename `%s' to: " (or (thing-at-point 'symbol t)
(error "no symbol at point"))) (error "no symbol at point")))
(or (thing-at-point 'symbol t) "") nil nil nil (or (thing-at-point 'symbol t) "") nil nil nil
(symbol-name (symbol-at-point))))) (symbol-name (symbol-at-point)))))
(eglot--server-capable-or-lose :renameProvider) (eglot--server-capable-or-lose :renameProvider)
(eglot--apply-workspace-edit (eglot--apply-workspace-edit
(jsonrpc-request (eglot--current-server-or-lose) (jsonrpc-request (eglot--current-server-or-lose)
:textDocument/rename `(,@(eglot--TextDocumentPositionParams) :textDocument/rename `(,@(eglot--TextDocumentPositionParams)
:newName ,newname)) :newName ,newname))
current-prefix-arg)) current-prefix-arg))
(fset #'jsonrpc--log-event #'ignore) (fset #'jsonrpc--log-event #'ignore)
(setopt eglot-events-buffer-size 0) (setopt eglot-events-buffer-size 0)
(defun eglot-format-buffer-on-save () (defun eglot-format-buffer-on-save ()
(when (not (derived-mode-p 'python-ts-mode)) (when (not (derived-mode-p 'python-ts-mode))
(add-hook 'before-save-hook #'eglot-format-buffer -10 t))) (add-hook 'before-save-hook #'eglot-format-buffer -10 t)))
(add-hook 'eglot-managed-mode-hook #'eglot-format-buffer-on-save) (add-hook 'eglot-managed-mode-hook #'eglot-format-buffer-on-save)
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(nix-mode . ("nixd")) '(nix-mode . ("nixd"))
`(c++-mode . ("clangd" "--clang-tidy" "--completion-style=detailed" "--header-insertion=never"))) `(c++-mode . ("clangd" "--clang-tidy" "--completion-style=detailed" "--header-insertion=never")))
:hook :hook
(rust-mode . eglot-ensure) (rust-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure) (rust-ts-mode . eglot-ensure)
(sh-script-mode . eglot-ensure) (sh-script-mode . eglot-ensure)
(python-mode . eglot-ensure) (python-mode . eglot-ensure)
(python-ts-mode . eglot-ensure) (python-ts-mode . eglot-ensure)
(json-mode . eglot-ensure) (json-mode . eglot-ensure)
(json-ts-mode . eglot-ensure) (json-ts-mode . eglot-ensure)
(nix-mode . eglot-ensure) (nix-mode . eglot-ensure)
(yaml-mode . eglot-ensure) (yaml-mode . eglot-ensure)
(yaml-ts-mode . eglot-ensure) (yaml-ts-mode . eglot-ensure)
(c-mode . eglot-ensure) (c-mode . eglot-ensure)
(c-ts-mode . eglot-ensure) (c-ts-mode . eglot-ensure)
(c++-mode . eglot-ensure) (c++-mode . eglot-ensure)
(c++-ts-mode . eglot-ensure) (c++-ts-mode . eglot-ensure)
(c3-ts-mode . eglot-ensure) (c3-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure) (rust-mode . eglot-ensure)
(go-mode . eglot-ensure) (go-mode . eglot-ensure)
(go-ts-mode . eglot-ensure)) (go-ts-mode . eglot-ensure))
(use-package rust-mode (add-hook 'c-mode-hook 'hide-ifdef-mode)
:ensure t) (add-hook 'c++-mode-hook 'hide-ifdef-mode)
(setq hide-ifdef-initially t)
(setq hide-ifdef-shadow 'font-lock-comment-face)
(use-package tuareg (use-package rust-mode
:ensure t :ensure t)
:mode ("\\.ml\\'" . tuareg-mode)
:hook (tuareg-mode . eglot-ensure))
(use-package merlin (use-package tuareg
:ensure t :ensure t
:hook (tuareg-mode . merlin-mode)) :mode ("\\.ml\\'" . tuareg-mode)
:hook (tuareg-mode . eglot-ensure))
(use-package glsl-mode (use-package merlin
:ensure t :ensure t
:mode ("\\.vert\\'" "\\.frag\\'" "\\.geom\\'")) :hook (tuareg-mode . merlin-mode))
(use-package eldoc-box (use-package glsl-mode
:custom :ensure t
(eldoc-box-max-pixel-width 1024) :mode ("\\.vert\\'" "\\.frag\\'" "\\.geom\\'"))
:custom-face
(eldoc-box-body ((t (:family "Iosevka Comfy Motion" :background "#181825" :foreground "#cdd6f4")))) (use-package eldoc-box
:config :custom
(setq eldoc-message-function #'ignore (eldoc-box-max-pixel-width 1024)
eldoc-idle-delay 0)) :custom-face
(eldoc-box-body ((t (:family "Iosevka Comfy Motion" :background "#181825" :foreground "#cdd6f4"))))
:config
(setq eldoc-message-function #'ignore
eldoc-idle-delay 0))
#+end_src #+end_src
*** Apheleia *** Apheleia