diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2026-04-20 08:32:12 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2026-04-20 08:32:12 -0400 |
| commit | 3c84b9ac9246862eb918409ad7ceb75a4905acc2 (patch) | |
| tree | e7442c01ccb9ca58f6bf3c68cd3821f7e7594c5f | |
| parent | Update emacs custom vars (diff) | |
| download | dotfiles-3c84b9ac9246862eb918409ad7ceb75a4905acc2.zip | |
Adjust emacs config
| -rw-r--r-- | .emacs.d/custom-vars.el | 4 | ||||
| -rw-r--r-- | .emacs.d/early-init.el | 14 | ||||
| -rw-r--r-- | .emacs.d/init.el | 32 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-appearance.el | 33 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-completion.el | 24 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-early.el | 44 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-format.el | 4 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-keys.el | 8 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lang.el | 17 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lsp.el | 3 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lsp.elc | bin | 0 -> 846 bytes | |||
| -rw-r--r-- | .emacs.d/lisp/et-md.el | 12 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-package.el | 2 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-tidy.el | 17 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-utils.el | 8 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-vc.el | 3 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-vi.el | 10 |
17 files changed, 155 insertions, 80 deletions
diff --git a/.emacs.d/custom-vars.el b/.emacs.d/custom-vars.el index 39d2e02..55ce4cd 100644 --- a/.emacs.d/custom-vars.el +++ b/.emacs.d/custom-vars.el @@ -6,8 +6,8 @@ ;; If there is more than one, they won't work right. '(package-selected-packages '(apheleia corfu doom-modeline embark-consult evil-collection flycheck - magit marginalia nord-theme orderless sly surround - treesit-auto vertico)) + magit marginalia markdown-mode no-littering nord-theme + orderless sly surround treesit-auto vertico)) '(safe-local-variable-values '((eval remove-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc t) diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 6012df5..da7059f 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -1,7 +1,7 @@ -;; Temporarily increase GC threshold during startup -(setq gc-cons-threshold most-positive-fixnum) - -;; Restore to normal value after startup (e.g. 100MB) -(add-hook 'emacs-startup-hook - (lambda () (setq gc-cons-threshold (* 100 1024 1024)))) - +;;; early-init.el --- Early init -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: +(add-to-list 'load-path "~/.emacs.d/lisp") +(require 'et-early) +(provide 'early-init) +;;; early-init.el ends here diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9351489..8dcdbcb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -19,40 +19,16 @@ ;;; Code: (add-to-list 'load-path "~/.emacs.d/lisp") (require 'et-package) +(require 'et-tidy) (require 'et-appearance) (require 'et-vi) +(require 'et-keys) (require 'et-vc) (require 'et-completion) (require 'et-format) (require 'et-lsp) - -;; Misc. grab bag items that aren't formally organized yet. -(setq custom-file (expand-file-name "custom-vars.el" user-emacs-directory)) -(when (file-exists-p custom-file) - (load custom-file)) - -(setq messages-log-max t) -(setq next-line-add-newlines t) - -(use-package project) - -(use-package which-key - :config - (which-key-mode 1)) - -(use-package surround - :bind-keymap ("M-'" . surround-keymap)) - -(use-package treesit-auto - :custom - (treesit-auto-install 'prompt) - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) - -(use-package sly - :init - (setq inferior-lisp-program "sbcl")) +(require 'et-lang) +(require 'et-md) (provide 'init) ;;; init.el ends here diff --git a/.emacs.d/lisp/et-appearance.el b/.emacs.d/lisp/et-appearance.el index e54903a..5f30f18 100644 --- a/.emacs.d/lisp/et-appearance.el +++ b/.emacs.d/lisp/et-appearance.el @@ -1,37 +1,8 @@ ;;; et-appearance --- Configuration for the "Look" of Emacs -*- lexical-binding: t; -*- -;; ;;; Commentary: -;; ;;; Code: (require 'et-utils) -(defvar et-monospace-font "Hack Nerd Font Mono" - "The font used by default and for any monospaced font usage.") -(defvar et-monospace-font-size (if (et-is-desktop-p) 192 160)) -(set-face-attribute 'default nil - :font (symbol-value 'et-monospace-font) - :height (symbol-value 'et-monospace-font-size)) - -;; Start emacs in full screen -;; -;; The t parameter appends to the hook, instead of prepending. -;; This means it'll be run after other hooks that might fiddle -;; with the frame size. -(add-hook 'window-setup-hook 'toggle-frame-maximized t) - -; Remove the menu bar (File Edit Options...) -(menu-bar-mode -1) - -; Remove the tool bar (if using the GUI) -(tool-bar-mode -1) - -; Skip the welcome screen -(setq inhibit-startup-screen t) - -;; Rather than an auditory noise, use a visual -;; flash instead. -(setq visible-bell t) - ;; Default to using line numbers in all modes ;; and turn them off one by one in the particular ;; modes where they don't make as much sense. @@ -45,6 +16,10 @@ special-mode-hook)) (add-hook mode (lambda () (display-line-numbers-mode 0)))) +;; Use relative line numbers since they are nice when using vim +;; keybindings with evil mode. +(setq display-line-numbers-type 'relative) + (use-package nord-theme :config (load-theme 'nord t)) diff --git a/.emacs.d/lisp/et-completion.el b/.emacs.d/lisp/et-completion.el index e0fc230..db47398 100644 --- a/.emacs.d/lisp/et-completion.el +++ b/.emacs.d/lisp/et-completion.el @@ -13,7 +13,6 @@ ;; Adjust completion search behavior (use-package orderless - :ensure t :custom (completion-styles '(orderless basic)) (completion-category-overrides '((file (styles partial-completion)))) @@ -30,6 +29,7 @@ :init (marginalia-mode)) +;; Add completion at point (use-package corfu :custom (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' @@ -42,9 +42,8 @@ (corfu-popupinfo-max-height 15) (corfu-auto t) (corfu-auto-delay 0.2) - (corfu-auto-trigger ".") + (corfu-auto-prefix 2) ;; trigger after 2 chars (corfu-quit-no-match 'separator) - :init (global-corfu-mode) (corfu-history-mode) @@ -79,5 +78,24 @@ ;; useful beyond Corfu. (read-extended-command-predicate #'command-completion-default-include-p)) +(use-package embark + :bind (("C-." . embark-act) + ("C-;" . embark-dwim) + ("C-h B" . embark-bindings)) + :init + (setq prefix-help-command #'embark-prefix-help-command)) + +(use-package embark-consult + :hook (embark-collect-mode . consult-preview-at-point-mode)) + +(use-package consult + :bind (("C-x b" . consult-buffer) + ("M-y" . consult-yank-pop) + ("M-g i" . consult-imenu) + ("M-s l" . consult-line) + ("M-s r" . consult-ripgrep) + ("M-s f" . consult-fd)) + :hook (completion-list-mode . consult-preview-at-point-mode)) + (provide 'et-completion) ;;; et-completion.el ends here diff --git a/.emacs.d/lisp/et-early.el b/.emacs.d/lisp/et-early.el new file mode 100644 index 0000000..a2b9cf6 --- /dev/null +++ b/.emacs.d/lisp/et-early.el @@ -0,0 +1,44 @@ +;;; et-early.el --- Early init configuration -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: +(require 'et-utils) + +;; Temporarily increase GC threshold during startup +(setq gc-cons-threshold most-positive-fixnum) + +;; Restore to normal value after startup (e.g. 100MB) +(add-hook 'emacs-startup-hook + (lambda () (setq gc-cons-threshold (* 100 1024 1024)))) + +(defvar et-monospace-font "Hack Nerd Font Mono" + "The font used by default and for any monospaced font usage.") +(defvar et-monospace-font-size (if (et-is-desktop-p) 192 160)) +(set-face-attribute 'default nil + :font (symbol-value 'et-monospace-font) + :height (symbol-value 'et-monospace-font-size)) + +;; Start emacs in full screen +;; +;; The t parameter appends to the hook, instead of prepending. +;; This means it'll be run after other hooks that might fiddle +;; with the frame size. +(add-hook 'window-setup-hook 'toggle-frame-maximized t) + +;; Remove the menu bar (File Edit Options...) +(menu-bar-mode -1) + +;; Remove the tool bar (if using the GUI) +(tool-bar-mode -1) + +;; Skip the welcome screen +(setq inhibit-startup-screen t) + +;; Turn off the bell +(setq visible-bell nil + ring-bell-function #'ignore) + +(setq messages-log-max t) +(setq next-line-add-newlines t) + +(provide 'et-early) +;;; et-early.el ends here diff --git a/.emacs.d/lisp/et-format.el b/.emacs.d/lisp/et-format.el index be4b9ac..70d2cbd 100644 --- a/.emacs.d/lisp/et-format.el +++ b/.emacs.d/lisp/et-format.el @@ -8,5 +8,9 @@ (setq-default flycheck-emacs-lisp-load-path 'inherit) +(use-package apheleia + :config + (apheleia-global-mode +1)) + (provide 'et-format) ;;; et-format.el ends here diff --git a/.emacs.d/lisp/et-keys.el b/.emacs.d/lisp/et-keys.el index 2b5a640..2071cb2 100644 --- a/.emacs.d/lisp/et-keys.el +++ b/.emacs.d/lisp/et-keys.el @@ -1,12 +1,10 @@ ;;; et-keys.el --- Set misc. custom keybindings -*- lexical-binding: t; -*- -;; ;;; Commentary: -;; ;;; Code: -;; Make ESC quit prompts. C-g will also do this, but it's -;; a convienence for my vim-pilled brain. -(global-set-key (kbd "<escape>") 'keyboard-escape-quit) +(use-package which-key + :config + (which-key-mode 1)) (provide 'et-keys) ;;; et-keys.el ends here diff --git a/.emacs.d/lisp/et-lang.el b/.emacs.d/lisp/et-lang.el new file mode 100644 index 0000000..237bc48 --- /dev/null +++ b/.emacs.d/lisp/et-lang.el @@ -0,0 +1,17 @@ +;;; et-lang.el --- Language config -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(use-package treesit-auto + :custom + (treesit-auto-install 'prompt) + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) + +(use-package sly + :init + (setq inferior-lisp-program "sbcl")) + +(provide 'et-lang) +;;; et-lang.el ends here diff --git a/.emacs.d/lisp/et-lsp.el b/.emacs.d/lisp/et-lsp.el index 8560c46..bdf8c21 100644 --- a/.emacs.d/lisp/et-lsp.el +++ b/.emacs.d/lisp/et-lsp.el @@ -3,9 +3,10 @@ ;;; Code: (use-package eglot - :defer t :hook ((python-mode . eglot-ensure) (go-mode . eglot-ensure)) + :init + (setq eglot-prefer-plaintext t) :config (add-to-list 'eglot-server-programs '(python-mode . ("ty" "server")))) diff --git a/.emacs.d/lisp/et-lsp.elc b/.emacs.d/lisp/et-lsp.elc Binary files differnew file mode 100644 index 0000000..8422538 --- /dev/null +++ b/.emacs.d/lisp/et-lsp.elc diff --git a/.emacs.d/lisp/et-md.el b/.emacs.d/lisp/et-md.el new file mode 100644 index 0000000..1cf5804 --- /dev/null +++ b/.emacs.d/lisp/et-md.el @@ -0,0 +1,12 @@ +;;; et-md.el --- Markdown -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(use-package markdown-mode + :mode ("README\\.md\\'" . gfm-mode) + :init (setq markdown-command "multimarkdown") + :bind (:map markdown-mode-map + ("C-c C-e" . markdown-do))) + +(provide 'et-md) +;;; et-md.el ends here diff --git a/.emacs.d/lisp/et-package.el b/.emacs.d/lisp/et-package.el index 1a99b12..3d11154 100644 --- a/.emacs.d/lisp/et-package.el +++ b/.emacs.d/lisp/et-package.el @@ -1,7 +1,5 @@ ;;; et-package.el --- Bootstrap Emacs package management and use-package -*- lexical-binding: t; -*- -;; ;;; Commentary: -;; ;;; Code: ;; First, we want to setup package.el for installing packages. diff --git a/.emacs.d/lisp/et-tidy.el b/.emacs.d/lisp/et-tidy.el new file mode 100644 index 0000000..9396e5a --- /dev/null +++ b/.emacs.d/lisp/et-tidy.el @@ -0,0 +1,17 @@ +;;; et-tidy.el --- Tidy up emacs -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(use-package no-littering + :config + (setq auto-save-file-name-transforms + `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) + (setq backup-directory-alist + `(("." . ,(no-littering-expand-var-file-name "backup/")))) + (setq custom-file + (expand-file-name "custom-vars.el" no-littering-etc-directory)) + (when (file-exists-p custom-file) + (load custom-file))) + +(provide 'et-tidy) +;;; et-tidy.el ends here diff --git a/.emacs.d/lisp/et-utils.el b/.emacs.d/lisp/et-utils.el index d14bc17..af5bdbd 100644 --- a/.emacs.d/lisp/et-utils.el +++ b/.emacs.d/lisp/et-utils.el @@ -31,5 +31,13 @@ as the file summary." (insert (funcall get-module-template (funcall get-current-file-name) summary)) (funcall move-to-center-of-code-section))))) +(defun open-init-file () + "Open the Emacs init file." + (interactive) + (find-file user-init-file) + (cd (file-name-directory user-init-file))) + +(global-set-key (kbd "C-c i") 'open-init-file) + (provide 'et-utils) ;;; et-utils.el ends here diff --git a/.emacs.d/lisp/et-vc.el b/.emacs.d/lisp/et-vc.el index fc78138..b71a6dd 100644 --- a/.emacs.d/lisp/et-vc.el +++ b/.emacs.d/lisp/et-vc.el @@ -1,10 +1,9 @@ ;;; et-vc.el --- Version control configuration -*- lexical-binding:t -*- -;; ;;; Commentary: -;; ;;; Code: (require 'vc-git) +(use-package project) (use-package magit) (global-set-key (kbd "C-c gu") diff --git a/.emacs.d/lisp/et-vi.el b/.emacs.d/lisp/et-vi.el index dfc9112..fe9011c 100644 --- a/.emacs.d/lisp/et-vi.el +++ b/.emacs.d/lisp/et-vi.el @@ -7,12 +7,20 @@ (setq evil-want-integration t) (setq evil-want-keybinding nil) (setq evil-want-C-u-scroll t) + (setq evil-undo-system 'undo-redo) (evil-mode 1)) (use-package evil-collection - :after evil :config (evil-collection-init)) +(use-package evil-commentary + :config + (evil-commentary-mode)) + +(use-package evil-surround + :config + (global-evil-surround-mode 1)) + (provide 'et-vi) ;;; et-vi.el ends here |