Updates to rust lsp, remove org-fc

This commit is contained in:
2025-12-24 09:22:33 +09:00
parent 0e1507668e
commit b8d1ff5f0d
3 changed files with 47 additions and 34 deletions

View File

@@ -78,18 +78,4 @@
"~/data2/Notes/inbox.org" "Words") "~/data2/Notes/inbox.org" "Words")
#'tatoeba-get-capture-template))) #'tatoeba-get-capture-template)))
;; This package adds flashcard functionality to org files.
(use-package org-fc
:straight (org-fc
:type git
:host nil
:repo "https://git.sr.ht/~l3kn/org-fc"
:branch "main"
:files (:defaults "awk" "demo.org"))
:after org
:ensure t
:defer nil
:custom
(org-fc-directories '("~/data2/Notes/")))
;;; 07-org.el ends here ;;; 07-org.el ends here

View File

@@ -7,6 +7,23 @@
;;; Code: ;;; Code:
;; This package provides syntax highlighting and some utilities for
;; working with rust code.
(use-package rust-mode
:ensure t
:defer t
:commands (rust-mode))
(add-hook 'rust-mode-hook #'eglot-ensure)
;; Clippy backend for flymake so we get propa error reporting in Rust
(use-package flymake-clippy
:hook (rust-mode . flymake-clippy-setup-backend))
(defun manually-activate-flymake ()
(add-hook 'flymake-diagnostic-functions #'eglot-flymake-backend nil t)
(flymake-mode 1))
;; Eglot is the built-in LSP client. ;; Eglot is the built-in LSP client.
(use-package eglot (use-package eglot
:ensure nil :ensure nil
@@ -17,15 +34,21 @@
eglot-rename eglot-rename
eglot-format-buffer) eglot-format-buffer)
:hook ((eglot-managed-mode . manually-activate-flymake))
:custom :custom
(eglot-report-progress nil) ; Prevent minibuffer spam (eglot-report-progress nil) ; Prevent minibuffer spam
:config :config
(add-to-list 'eglot-server-programs '((rust-mode) . ("rust-analyzer"))) (add-to-list 'eglot-server-programs '((rust-mode) . ("rust-analyzer" :initializationOptions
( :procMacro (:enable t)
:cargo ( :buildScripts (:enable t) )))))
(add-to-list 'eglot-server-programs '(nix-mode . ("nil"))) (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))
(add-to-list 'eglot-stay-out-of 'flymake)
;; Optimizations ;; Optimizations
(fset #'jsonrpc--log-event #'ignore) (fset #'jsonrpc--log-event #'ignore)
(setq jsonrpc-event-hook nil)) (setq jsonrpc-event-hook nil)
)
;; This function raises the window to the front using KDE KWin. ;; This function raises the window to the front using KDE KWin.
(defun my/raise-window () (defun my/raise-window ()
@@ -44,28 +67,19 @@
(add-hook 'gdscript-mode-hook #'eglot-ensure) (add-hook 'gdscript-mode-hook #'eglot-ensure)
;; This package provides syntax highlighting and some utilities for
;; working with rust code.
(use-package rust-mode
:ensure t
:defer t
:commands (rust-mode))
(add-hook 'rust-mode-hook #'eglot-ensure)
;; This package provides integration with Prolog (SWI). ;; This package provides integration with Prolog (SWI).
(use-package sweeprolog (use-package sweeprolog
:straight (sweeprolog :type git :straight (sweeprolog :type git
:host nil :host nil
:repo "https://git.sr.ht/~eshel/sweep" :repo "https://git.sr.ht/~eshel/sweep"
:branch "main" :branch "main"
:files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because :files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because
; the normal one did not ; the normal one did not
; build properly. ; build properly.
:ensure t :ensure t
:defer t :defer t
:commands (sweeprolog-mode :commands (sweeprolog-mode
sweeprolog-top-level) sweeprolog-top-level)
:init :init
(setq sweeprolog-swipl-path "swipl")) (setq sweeprolog-swipl-path "swipl"))
@@ -139,4 +153,17 @@
(indent-bars-treesit-wrap '((rust arguments parameters))) (indent-bars-treesit-wrap '((rust arguments parameters)))
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode)) :hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
;; Ellama allows using LLMs from emacs.
(use-package ellama
:ensure nil
:defer t
:bind ("C-c e" . ellama)
:init (setopt ellama-auto-scroll t)
:commands (ellama)
:config
;; show ellama context in header line in all buffers
(ellama-context-header-line-global-mode +1)
;; show ellama session id in header line in all buffers
(ellama-session-header-line-global-mode +1))
;;; 15-lsp.el end here ;;; 15-lsp.el end here

View File

@@ -3,7 +3,7 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(auth-source-save-behavior nil)) )
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.