.emacs.d/init.el

81 lines
2.8 KiB
EmacsLisp
Raw Normal View History

;;; init.el --- A (reasonably) minimal initialization file for Emacs.
;; Manage package configuration via `use-package`.
;; https://github.com/jwiegley/use-package
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("stable" . "https://stable.melpa.org/packages/")))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; Define a couple simple helper functions for loading user-defined
;; configuration files.
(defconst user-init-dir "~/.emacs.d/")
(defun load-user-file (file)
"Load FILE in the current user's configuration directory.
File names which are prefixed with an underscore will be ignored."
(interactive "f")
(unless (string-prefix-p "_" (file-name-nondirectory file))
(load-file (expand-file-name file user-init-dir))))
(defun load-user-dir (dir)
"Recursively load all files in directory DIR.
DIR should be relative to the user's configuration directory."
(interactive "f")
(setq config-dir (file-name-concat user-init-dir dir))
(dolist (file (directory-files-recursively config-dir ""))
(load-user-file file)))
;; Configure how and where backup files are created:
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
backup-by-copying t ; Don't delink hardlinks
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups
kept-new-versions 20 ; How many of the newest versions to keep
kept-old-versions 5 ; How many of the oldest versions to keep
)
;; Load all user-defined configuration files:
(load-user-file "editor.el")
(load-user-file "interface.el")
(load-user-file "key-bindings.el")
(load-user-file "typography.el")
(load-user-dir "pkg")
(load-user-dir "lang")
;; WARNING: Don't touch anything after this comment!
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(git-gutter:added-sign " +")
'(git-gutter:deleted-sign " -")
'(git-gutter:modified-sign " *")
'(package-selected-packages
'(yaml-mode toml-mode markdown-mode yasnippet which-key vertico super-save solaire-mode smartparens rainbow-delimiters nerd-icons nerd-icons-dired magit lsp-mode hl-todo hl-line git-gutter flycheck diminish crux)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)