Emacs config wip, split to better fit modules.

This commit is contained in:
2026-10-26 08:06:00 +02:00
parent 2e6bbc77fd
commit 1c4f950e3f
6 changed files with 503 additions and 87 deletions
+41
View File
@@ -0,0 +1,41 @@
;;; build.el --- Project build, set up for Evil -*- lexical-binding: t; -*-
;;; Commentary:
;; Loaded from init.el after Evil.
;;
;; :build Run ./build.sh from the project root.
;; :build ARGS Run ./build.sh ARGS, e.g. :build release -v
;;
;; The compilation buffer opens at the bottom (45% height, full width) and
;; takes focus when the build starts. ANSI colours are rendered.
;; Kill a running build with M-x kill-compilation.
;;; Code:
(setq compile-command "./build.sh"
compilation-read-command nil ; run without prompting
compilation-ask-about-save nil
compilation-scroll-output t)
(add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)
;; Compilation buffer at the bottom, full frame width.
(add-to-list 'display-buffer-alist
'((derived-mode . compilation-mode)
(display-buffer-reuse-window display-buffer-at-bottom)
(window-height . 0.45)))
;; Focus the compilation window when a build starts.
(add-hook 'compilation-start-hook
(lambda (proc)
(when-let* ((win (get-buffer-window (process-buffer proc))))
(select-window win))))
;; :build runs ./build.sh; :build ARGS appends ARGS.
(evil-define-command my/ex-build (args)
"Run `./build.sh ARGS' from the project root."
(interactive "<a>")
(let ((compile-command (concat "./build.sh " args))) ; nil args -> ""
(project-compile)))
(evil-ex-define-cmd "build" #'my/ex-build)
;;; build.el ends here