Merge branch 'main' of github.com:iamtoaster/emacs-dotfiles

This commit is contained in:
2026-01-09 21:47:29 +09:00
7 changed files with 114 additions and 69 deletions

View File

@@ -7,6 +7,23 @@
;;; 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.
(use-package eglot
:ensure nil
@@ -17,15 +34,21 @@
eglot-rename
eglot-format-buffer)
:hook ((eglot-managed-mode . manually-activate-flymake))
:custom
(eglot-report-progress nil) ; Prevent minibuffer spam
(eglot-report-progress nil) ; Prevent minibuffer spam
: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-stay-out-of 'flymake)
;; Optimizations
(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.
(defun my-raise-window ()
@@ -47,28 +70,19 @@ Won't work if the script is not there."
(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).
(use-package sweeprolog
:straight (sweeprolog :type git
:host nil
:repo "https://git.sr.ht/~eshel/sweep"
:branch "main"
:files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because
; the normal one did not
; build properly.
:host nil
:repo "https://git.sr.ht/~eshel/sweep"
:branch "main"
:files ("*.el" "sweep.pl" "sweep.texi")) ; Custom recipe because
; the normal one did not
; build properly.
:ensure t
:defer t
:commands (sweeprolog-mode
sweeprolog-top-level)
sweeprolog-top-level)
:init
(setq sweeprolog-swipl-path "swipl"))
@@ -125,10 +139,10 @@ control codes are not supported."
;; Lispy provides structural editing to lisp modes.
(use-package lispy
:ensure t
:defer t)
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
(if (memq 'lispy-autoloads features)
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))))
;; This package adds indent bars. Currently only configured for rust and python.
(use-package indent-bars
@@ -154,4 +168,17 @@ control codes are not supported."
(indent-bars-treesit-wrap '((rust arguments parameters)))
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
;;; 15-lsp.el ends here
;; 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