The great config remake.

I decided to go back to the basics with this one. Only the packages I think
I *REALLY* need (or want) are left, the rest are replaced by the built-in
alternatives or even better, removed.
This commit is contained in:
2026-03-13 15:51:28 +09:00
parent 0f5a63df6d
commit 34b25f2352
9 changed files with 98 additions and 632 deletions

View File

@@ -1,5 +1,11 @@
;;; post-init.el --- This file is loaded after init.el. -*- no-byte-compile: t; lexical-binding: t; -*-
(load-theme 'modus-operandi)
(set-face-attribute 'default nil :height 110 :font "Iosevka Nerd Font" :weight 'normal)
(setq initial-frame-alist
'((width . 100) (height . 25)))
;; Use straight.el for package management, integrate with use-package.
(setq straight-use-package-by-default t)
@@ -22,18 +28,14 @@
(unless (memq 'use-package-autoloads features)
(straight-use-package 'use-package))
;; The compile-angel package automatically byte-compiles and
;; native-compiles Emacs Lisp libraries. It should be loaded before
;; any other package.
(use-package compile-angel
:demand t
:custom
(compile-angel-verbose nil)
:config
(compile-angel-on-load-mode)
(add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode))
;; Minibuffers and stuff
(setq enable-recursive-minibuffers t)
(which-key-mode t)
;; Modeline
(display-time-mode)
(setq display-time-24hr-format t)
;; Diminish allows us to clear up our modeline
(use-package diminish
:ensure t)
@@ -41,11 +43,49 @@
;; integration to diminish it. So, we do it manually here.
(diminish 'compile-angel-on-save-local-mode)
(diminish 'compile-angel-on-load-mode)
;; Since I did not explicitly install it, I cannot use the use-package
;; integration to deminish eldoc either. So I do it explicitly here.
(diminish 'eldoc-mode)
;; Avoid backups or lockfiles to prevent creating world-readable copies of files
(setq create-lockfiles nil)
(setq make-backup-files nil)
(setq backup-directory-alist
`((".*" . ,(expand-file-name "backup" user-emacs-directory))))
(setq tramp-backup-directory-alist backup-directory-alist)
(setq backup-by-copying-when-linked t)
(setq backup-by-copying t) ; Backup by copying rather renaming
(setq delete-old-versions t) ; Delete excess backup versions silently
(setq version-control t) ; Use version numbers for backup files
(setq kept-new-versions 5)
(setq kept-old-versions 5)
;; Syntax highlights
(setq treesit-font-lock-level 4)
;; NixOS Specific
(unless (functionp 'nix--profile-paths)
(message "Not on NixOS. Will try to install packages usually managed by it through use-package.")
(use-package compile-angel
:demand t
:custom
(compile-angel-verbose nil)
:config
(compile-angel-on-load-mode)
(add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode))
(use-package vterm
:defer t
:ensure t)
(use-package nix-ts-mode
:defer t
:ensure t))
;; LSP and stuff
(add-hook 'nix-ts-mode-hook 'eglot-ensure)
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-ts-mode))
;; Load the configs from plug-in files.
(let ((config-dir (concat minimal-emacs-user-directory ".config.d")))
(if (not (file-exists-p config-dir))