diff options
Diffstat (limited to '')
| -rw-r--r-- | .emacs.d/early-init.el | 7 | ||||
| -rw-r--r-- | .emacs.d/init.el | 35 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-appearance.el | 55 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-completion.el | 105 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-early.el | 44 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-format.el | 17 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-keys.el | 11 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lang.el | 27 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lsp.el | 15 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-lsp.elc | bin | 846 -> 0 bytes | |||
| -rw-r--r-- | .emacs.d/lisp/et-md.el | 13 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-org.el | 10 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-package.el | 34 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-tidy.el | 18 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-utils.el | 41 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-vc.el | 106 | ||||
| -rw-r--r-- | .emacs.d/lisp/et-vi.el | 30 | ||||
| -rw-r--r-- | macos/Brewfile | 5 |
18 files changed, 3 insertions, 570 deletions
diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el deleted file mode 100644 index da7059f..0000000 --- a/.emacs.d/early-init.el +++ /dev/null @@ -1,7 +0,0 @@ -;;; 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 deleted file mode 100644 index bae5f4f..0000000 --- a/.emacs.d/init.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; init.el --- Emacs Configuration entrypoint -*- lexical-binding: t; -*- -;; -;;; Commentary: -;; init.el serves as the entrypoint for this Emacs configuration. -;; -;; The majority of the configuration lives within the lisp/ directory. -;; Each Lisp file is intended to be a self-contained unit for some aspect -;; of my usage of Emacs. Each file name and definitions within a file -;; are prefixed with et- to namespace them. -;; -;; Because the configuration is generally in these self-contained Lisp -;; files, the primary role of init.el is to bootstrap the loading of these -;; files. -;; -;; Therefore, this entrypoint file: -;; * Sets up the Emacs load path to include the Lisp directory. -;; * Loads each Lisp file in the necessary order. -;; -;;; 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) -(require 'et-lang) -(require 'et-md) -(require 'et-org) - -(provide 'init) -;;; init.el ends here diff --git a/.emacs.d/lisp/et-appearance.el b/.emacs.d/lisp/et-appearance.el deleted file mode 100644 index 2b82459..0000000 --- a/.emacs.d/lisp/et-appearance.el +++ /dev/null @@ -1,55 +0,0 @@ -;;; et-appearance --- Configuration for the "Look" of Emacs -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: -(require 'et-utils) - -;; Default to using line numbers in all modes. -(global-display-line-numbers-mode 1) -;; Turn off line numbers in modes where they -;; don't make as much sense. -(dolist (mode '(text-mode-hook - man-mode-hook - org-mode-hook - term-mode-hook - eshell-mode-hook - shell-mode-hook - 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) - -(setq column-number-mode t) - -;; Set the emacs frame title to the full file path. -;; -;; Source - https://stackoverflow.com/a/3669681 -;; Posted by Jérôme Radix, modified by community. See post 'Timeline' for change history -;; Retrieved 2026-04-25, License - CC BY-SA 3.0 -(setq frame-title-format - (list (format "%s %%S: %%j " (system-name)) - '(buffer-file-name "%f" (dired-directory dired-directory "%b")))) - -(use-package nerd-icons - :ensure t) - -(use-package doom-modeline - :ensure t - :init - (doom-modeline-mode 1)) - -(use-package doom-themes - :ensure t - :custom - (doom-themes-enable-bold t) - (doom-themes-enable-italic nil) - :config - (load-theme 'doom-nord t)) - ;; Enable flashing mode-line on errors - ;(doom-themes-visual-bell-config) - ;; Corrects (and improves) org-mode's native fontification. - ;(doom-themes-org-config)) - -(provide 'et-appearance) -;;; et-appearance.el ends here diff --git a/.emacs.d/lisp/et-completion.el b/.emacs.d/lisp/et-completion.el deleted file mode 100644 index 1939f81..0000000 --- a/.emacs.d/lisp/et-completion.el +++ /dev/null @@ -1,105 +0,0 @@ -;;; et-completion.el --- Enhance the Emacs completion behavior -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -;; Add a vertical completion UI -(use-package vertico - :ensure t - :custom - (vertico-cycle t) - :init - (vertico-mode)) - -;; Adjust completion search behavior -(use-package orderless - :ensure t - :custom - (completion-styles '(orderless basic)) - (completion-category-overrides '((file (styles partial-completion)))) - (completion-pcm-leading-wildcard t)) - -;; Persist history over emacs restarts. -;; This allows vertico to sort by history position. -(use-package savehist - :init - (savehist-mode)) - -;; Add documentation alongside the completion items -(use-package marginalia - :ensure t - :init - (marginalia-mode)) - -;; Add completion at point -(use-package corfu - :ensure t - :custom - (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' - ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary - ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match - ;; (corfu-preview-current nil) ;; Disable current candidate preview - ;; (corfu-preselect 'prompt) ;; Preselect the prompt - ;; (corfu-on-exact-match 'insert) ;; Configure handling of exact matches - (corfu-popupinfo-delay '(0.5 . 0.2)) ;; (first-show . subsequent) - (corfu-popupinfo-max-height 15) - (corfu-auto t) - (corfu-auto-delay 0.2) - (corfu-auto-prefix 2) ;; trigger after 2 chars - (corfu-quit-no-match 'separator) - :init - (global-corfu-mode) - (corfu-history-mode) - (corfu-popupinfo-mode)) - -(use-package dabbrev - ;; Swap M-/ and C-M-/ - :bind (("M-/" . dabbrev-completion) - ("C-M-/" . dabbrev-expand)) - :config - (add-to-list 'dabbrev-ignored-buffer-regexps "\\` ") - (add-to-list 'dabbrev-ignored-buffer-modes 'authinfo-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode) - (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode)) - -(use-package emacs - :custom - ;; TAB cycle if there are only few candidates - ;; (completion-cycle-threshold 3) - - ;; Enable indentation+completion using the TAB key. - ;; `completion-at-point' is often bound to M-TAB. - (tab-always-indent 'complete) - - ;; Emacs 30 and newer: Disable Ispell completion function. - ;; Try `cape-dict' as an alternative. - (text-mode-ispell-word-completion nil) - - ;; Hide commands in M-x which do not apply to the current mode. Corfu - ;; commands are hidden, since they are not used via M-x. This setting is - ;; useful beyond Corfu. - (read-extended-command-predicate #'command-completion-default-include-p)) - -(use-package consult - :ensure t - :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)) - -(use-package embark - :ensure t - :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)) - -(provide 'et-completion) -;;; et-completion.el ends here diff --git a/.emacs.d/lisp/et-early.el b/.emacs.d/lisp/et-early.el deleted file mode 100644 index a2b9cf6..0000000 --- a/.emacs.d/lisp/et-early.el +++ /dev/null @@ -1,44 +0,0 @@ -;;; 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 deleted file mode 100644 index 4805b8a..0000000 --- a/.emacs.d/lisp/et-format.el +++ /dev/null @@ -1,17 +0,0 @@ -;;; et-format.el --- Code formatting configuration ;; -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package flycheck - :ensure t - :init (global-flycheck-mode)) - -(setq-default flycheck-emacs-lisp-load-path 'inherit) - -(use-package apheleia - :ensure t - :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 deleted file mode 100644 index fb7c57a..0000000 --- a/.emacs.d/lisp/et-keys.el +++ /dev/null @@ -1,11 +0,0 @@ -;;; et-keys.el --- Set misc. custom keybindings -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package which-key - :ensure t - :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 deleted file mode 100644 index a3b1fbb..0000000 --- a/.emacs.d/lisp/et-lang.el +++ /dev/null @@ -1,27 +0,0 @@ -;;; et-lang.el --- Language config -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package treesit-auto - :ensure t - :custom - (treesit-auto-install 'prompt) - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) - -(use-package sly - :ensure t - :init - (setq inferior-lisp-program "sbcl")) - -(use-package geiser - :pin "melpa" - :ensure t) - -(use-package geiser-guile - :pin "melpa" - :ensure t) - -(provide 'et-lang) -;;; et-lang.el ends here diff --git a/.emacs.d/lisp/et-lsp.el b/.emacs.d/lisp/et-lsp.el deleted file mode 100644 index dc0718a..0000000 --- a/.emacs.d/lisp/et-lsp.el +++ /dev/null @@ -1,15 +0,0 @@ -;;; et-lsp.el --- Setup LSP servers for necessary languages -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package eglot - :ensure 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")))) - -(provide 'et-lsp) -;;; et-lsp.el ends here diff --git a/.emacs.d/lisp/et-lsp.elc b/.emacs.d/lisp/et-lsp.elc Binary files differdeleted file mode 100644 index 8422538..0000000 --- a/.emacs.d/lisp/et-lsp.elc +++ /dev/null diff --git a/.emacs.d/lisp/et-md.el b/.emacs.d/lisp/et-md.el deleted file mode 100644 index c48d5f2..0000000 --- a/.emacs.d/lisp/et-md.el +++ /dev/null @@ -1,13 +0,0 @@ -;;; et-md.el --- Markdown -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package markdown-mode - :ensure t - :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-org.el b/.emacs.d/lisp/et-org.el deleted file mode 100644 index a66bc5c..0000000 --- a/.emacs.d/lisp/et-org.el +++ /dev/null @@ -1,10 +0,0 @@ -;;; et-org.el --- Org mode -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package org - :mode (("\\.org$" . org-mode)) - :ensure org-plus-contrib) - -(provide 'et-org) -;;; et-org.el ends here diff --git a/.emacs.d/lisp/et-package.el b/.emacs.d/lisp/et-package.el deleted file mode 100644 index 0e8730b..0000000 --- a/.emacs.d/lisp/et-package.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; 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. -;; This is emac's built-in package manager, and we'll use it -;; to install use-package itself. -;; -;; To list the packages and see what is avaiable, we can use -;; M-x list-packages. -(require 'package) - -;; Package archives are where we want to install packages from. -;; It is expected that we setup this variable before we call -;; package-initialize. -(setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) -(package-initialize) - -;; If use package isn't installed on the current system, -;; we want to build the package contents and install use-package. -;; -;; Do note that the package contents can get out of date, and there -;; is no automatic process here for refreshing them. Instead, we'll -;; need to do M-x package-refresh-contents occasionally. -(unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) - -(require 'use-package) - -(provide 'et-package) -;;; et-package.el ends here diff --git a/.emacs.d/lisp/et-tidy.el b/.emacs.d/lisp/et-tidy.el deleted file mode 100644 index f50cf8f..0000000 --- a/.emacs.d/lisp/et-tidy.el +++ /dev/null @@ -1,18 +0,0 @@ -;;; et-tidy.el --- Tidy up emacs -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package no-littering - :ensure t - :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 deleted file mode 100644 index 17a0e77..0000000 --- a/.emacs.d/lisp/et-utils.el +++ /dev/null @@ -1,41 +0,0 @@ -;;; et-utils.el --- Utilities for my Emacs configuration -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(defun et-is-desktop-p () - "Check if the current system is my desktop system." - (string-match-p "desktop" (system-name))) - -(defun et-insert-elisp-template (summary) - "Insert a elisp template into the buffer. - -SUMMARY will be inserted into the header docstring -as the file summary." - (interactive (list (read-string "summary: "))) - (let ((move-to-center-of-code-section (lambda () (forward-line -3))) - (get-current-file-name (lambda () (file-name-sans-extension (file-name-nondirectory buffer-file-name)))) - (get-module-template (lambda (module-name summary) - (format ";;; %s.el --- %s -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - - - -(provide '%s) -;;; %s.el ends here" module-name summary module-name module-name)))) - (if (not (buffer-file-name)) - (message "No file visited.") - (progn - (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 deleted file mode 100644 index 058f81c..0000000 --- a/.emacs.d/lisp/et-vc.el +++ /dev/null @@ -1,106 +0,0 @@ -;;; et-vc.el --- Version control configuration -*- lexical-binding:t -*- -;;; Commentary: -;;; Code: -(require 'vc-git) - -(use-package project) - -(use-package magit - :ensure t) - -(setq vc-follow-symlinks t) - -(global-set-key (kbd "C-c gu") - 'et-generate-remote-git-url) - -(defun et-generate-remote-git-url () - "Generate a remote URL for the current buffer file and line number. - -* The remote URL can be HTTPS or SSH. -* The git hosting provider is determined via the git remote `origin` url. -* Only Github and SourceHut are supported as a hosting provider. - -For example, if the point is on line 12 of example.el on head SHA -abc123, and the git remote origin url is set to a github URL, then a -URL such https://github.com/myuser/myrepo/blob/abc123/example.el#L12 -would be added to the kill ring." - (interactive) - - (if (not buffer-file-name) - (message "Not visiting a file.") - (let* ((remote-url (vc-git-repository-url buffer-file-name "origin")) - (head-sha (vc-git-working-revision buffer-file-name)) - (relative-file-path (file-relative-name buffer-file-name - (vc-git-root buffer-file-name))) - (line-num (line-number-at-pos))) - - (if (et--is-supported-provider-p remote-url) - (progn - (kill-new (et--generate-remote-git-url remote-url head-sha relative-file-path line-num)) - (message "Copied remote git URL")) - (message (format "%s is not a supported git hosting provider." remote-url)))))) - -(defun et--is-supported-provider-p (url) - "Check whether URL is a supported git hosting provider for URL generation." - (not (null (et--get-git-hosting-provider url)))) - -(defun et--get-git-hosting-provider (url) - "Get the git hosting provider for the given URL. - -The supported providers are github and sourcehut. If the URL -corresponds to an unsupported provider, null is returned." - (cond - ((string-match-p "github\\.com" url) 'github) - ((string-match-p "git\\.sr\\.ht" url) 'sourcehut))) - -(defun et--generate-remote-git-url (remote-url head-sha relative-file-path line-num) - (let ((provider (et--get-git-hosting-provider remote-url))) - (cond - ((eq 'github provider) - (et--gh-generate-remote-git-url remote-url head-sha relative-file-path line-num)) - ((eq 'sourcehut provider) - (et--sh-generate-remote-git-url remote-url head-sha relative-file-path line-num))))) - -(defun et--gh-generate-remote-git-url (remote-url head-sha relative-file-path line-num) - (format "https://github.com/%s/blob/%s/%s#L%d" - (et--extract-repo-path "https://github.com" remote-url) - head-sha - relative-file-path - line-num)) - -(defun et--sh-generate-remote-git-url (remote-url head-sha relative-file-path line-num) - (format "https://git.sr.ht/%s/tree/%s/item/%s#L%d" - (et--extract-repo-path "https://git.sr.ht" remote-url) - head-sha - relative-file-path - line-num)) - -(defun et--extract-repo-path (base-url remote-url) - "Extract the repository path from the REMOTE-URL. - -BASE-URL is used to determine where the repository part of the -REMOTE-URL starts if the REMOTE-URL is a http URL. - -Example: - (et--extract-repo-path - \"https://github.com\" - \"https://github.com/user/repo\") - => \"user/repo\" - - (et--extract-repo-path - \"https://git.sr.ht\" - \"git@git.sr.ht:~eugenetriguba/repo\") - => \"~eugenetriguba/repo\"" - (if (et--git-ssh-url-p remote-url) - (substring remote-url (+ 1 (string-match ":" remote-url))) - (replace-regexp-in-string - (format "%s/\\(.*?\\)\\(.git\\)?$" base-url) - "\\1" - remote-url))) - -(defun et--git-ssh-url-p (url) - "Check whether URL is a SSH-based Git origin URL." - (string-prefix-p "git@" url)) - -(provide 'et-vc) -;;; et-vc.el ends here diff --git a/.emacs.d/lisp/et-vi.el b/.emacs.d/lisp/et-vi.el deleted file mode 100644 index 15c7638..0000000 --- a/.emacs.d/lisp/et-vi.el +++ /dev/null @@ -1,30 +0,0 @@ -;;; et-vi.el --- Vi keybindings -*- lexical-binding: t; -*- -;;; Commentary: -;;; Code: - -(use-package evil - :ensure t - :init - (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 - :ensure t - :config - (evil-collection-init)) - -(use-package evil-commentary - :ensure t - :config - (evil-commentary-mode)) - -(use-package evil-surround - :ensure t - :config - (global-evil-surround-mode 1)) - -(provide 'et-vi) -;;; et-vi.el ends here diff --git a/macos/Brewfile b/macos/Brewfile index 6080039..6d9f432 100644 --- a/macos/Brewfile +++ b/macos/Brewfile @@ -1,15 +1,16 @@ brew "ansible" -brew "git" brew "fd" brew "fzf" +brew "git" brew "hashicorp/tap/packer", trusted: true +brew "neovim" brew "oksh" brew "qemu" brew "ripgrep" brew "shellcheck" brew "shfmt" cask "1password" -cask "emacs-app" +cask "claude-code" cask "fastmail" cask "firefox" cask "font-hack-nerd-font" |