Set the editor theme, plus... a bunch of miscellaneous changes

This commit is contained in:
Jesse Braham 2025-02-18 21:20:24 +01:00
parent 4e06e20b89
commit 068f63d507
9 changed files with 73 additions and 31 deletions

2
.gitignore vendored
View File

@ -3,5 +3,7 @@ backup/
elpa/
transient/
.DS_Store
.lsp-session-*
history
recentf

View File

@ -20,3 +20,10 @@
tab-width 4)
(setq require-final-newline t)
(add-hook 'before-save-hook 'whitespace-cleanup)
;; Make sure that UTF-8 is *ALWAYS* the default encoding.
(set-charset-priority 'unicode)
(prefer-coding-system 'utf-8-unix)
;; Prettify symbols (eg. lambda -> λ).
(global-prettify-symbols-mode)

48
init.el
View File

@ -17,6 +17,17 @@
(package-install 'use-package))
;; 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
)
;; Define a couple simple helper functions for loading user-defined
;; configuration files.
@ -24,9 +35,12 @@
(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."
File names which are prefixed with an underscore or which do not have the
extension '.el' will be ignored."
(interactive "f")
(unless (string-prefix-p "_" (file-name-nondirectory file))
(setq file-name (file-name-nondirectory file))
(when (and (string-suffix-p ".el" file-name)
(not (string-prefix-p "_" file-name)))
(load-file (expand-file-name file user-init-dir))))
(defun load-user-dir (dir)
@ -38,34 +52,23 @@
(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
)
;; Diminish some built-in modes that we don't really care about:
(add-hook 'eldoc-mode-hook (lambda () (diminish 'eldoc-mode)))
(add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))
;; Load all user-defined configuration files:
;; 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-file "theme.el")
(load-user-dir "pkg")
(load-user-dir "lang")
;; Diminish some built-in modes that we don't really care about.
(add-hook 'eldoc-mode-hook (lambda () (diminish 'eldoc-mode)))
(add-hook 'hs-minor-mode-hook (lambda () (diminish 'hs-minor-mode)))
;; WARNING: Don't touch anything after this comment!
(custom-set-variables
@ -76,8 +79,7 @@
'(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)))
'(package-selected-packages nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

15
lang/rust.el Normal file
View File

@ -0,0 +1,15 @@
;; Rust
;; https://github.com/emacs-rustic/rustic
(use-package rustic
:ensure t
:custom
(rustic-cargo-use-last-stored-arguments t)
:bind
(:map rustic-mode-map
("M-?" . lsp-find-references)
("C-c C-c l" . flycheck-list-errors)
("C-c C-c a" . lsp-execute-code-action)
("C-c C-c r" . lsp-rename)
("C-c C-c q" . lsp-workspace-restart)
("C-c C-c Q" . lsp-workspace-shutdown)
("C-c C-c s" . lsp-rust-analyzer-status)))

View File

@ -3,5 +3,10 @@
(use-package hl-todo
:ensure t
:config
(setq hl-todo-keyword-faces
'(("FIXME" . "#f7768e")
("HACK" . "#7aa2f7")
("NOTE" . "#e0af68")
("TODO" . "#bb9af7")))
(add-hook 'prog-mode-hook #'hl-todo-mode)
(add-hook 'text-mode-hook #'hl-todo-mode))

View File

@ -2,5 +2,10 @@
;; https://github.com/emacs-lsp/lsp-mode
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:hook ((lsp-mode . lsp-enable-which-key-integration)))
:diminish lsp-mode
:commands lsp
:init
;; Set prefix for lsp-command-keymap:
(setq lsp-keymap-prefix "C-c l")
:hook
((lsp-mode . lsp-enable-which-key-integration)))

5
pkg/org.el Normal file
View File

@ -0,0 +1,5 @@
;; Org mode.
(use-package org
:ensure t
:mode
(("\\.org$" . org-mode)))

7
theme.el Normal file
View File

@ -0,0 +1,7 @@
;; https://github.com/doomemacs/themes
(use-package doom-themes
:ensure t
:config
(load-theme 'doom-tokyo-night t)
;(doom-themes-visual-bell-config)
)

View File

@ -1,6 +0,0 @@
;; Make sure that UTF-8 is *ALWAYS* the default encoding.
(set-charset-priority 'unicode)
(prefer-coding-system 'utf-8-unix)
;; Prettify symbols (eg. lambda -> λ).
(global-prettify-symbols-mode)