- Remove work/laptop detection logic from nvim and emacs configs; each
package now has a self-contained init that requires no runtime checks
- Create shared/ stow package containing nvim/init.lua, emacs/init.el,
common-dev-settings.el, org-bindings.el, tmux, ghostty, and ranger
- Rename laptop-languages.lua / work-languages.lua → languages.lua in
each package; shared/init.lua uses require('languages') generically
- Rename work-dev-settings.el → dev-settings.el to match laptop naming
- Expand work/ to include the full set of dev tools (tmux, ghostty,
ranger, emacs, neovim) without email/calendar tooling
- Add Makefile with `make laptop` and `make work` targets (each runs
a single `stow shared <profile>` invocation)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
160 lines
4.1 KiB
EmacsLisp
160 lines
4.1 KiB
EmacsLisp
;; init.el
|
|
|
|
(defun rh/load-user-file (file)
|
|
"Load FILE from `user-emacs-directory' when it exists."
|
|
(let ((path (expand-file-name file user-emacs-directory)))
|
|
(when (file-exists-p path)
|
|
(load path nil 'nomessage))))
|
|
|
|
;;; Startup/UI ---------------------------------------------------------------
|
|
|
|
(setq inhibit-startup-message t
|
|
visible-bell t)
|
|
|
|
(scroll-bar-mode -1)
|
|
(tool-bar-mode -1)
|
|
(tooltip-mode -1)
|
|
(menu-bar-mode -1)
|
|
|
|
;;; Editing Defaults ---------------------------------------------------------
|
|
|
|
(global-display-line-numbers-mode 1)
|
|
(setq display-line-numbers-type 'relative)
|
|
|
|
(setq make-backup-files nil
|
|
auto-save-default nil
|
|
create-lockfiles nil)
|
|
|
|
(setq vc-follow-symlinks t
|
|
find-file-visit-truename t)
|
|
|
|
;;; Package Manager ----------------------------------------------------------
|
|
|
|
(require 'package)
|
|
|
|
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
|
("elpa" . "https://elpa.gnu.org/packages/")))
|
|
|
|
(package-initialize)
|
|
(unless package-archive-contents
|
|
(package-refresh-contents))
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
(package-install 'use-package))
|
|
|
|
(require 'use-package)
|
|
(setq use-package-always-ensure t)
|
|
|
|
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
|
|
|
;;; Style/Theme --------------------------------------------------------------
|
|
|
|
(use-package catppuccin-theme
|
|
:init
|
|
(setq catppuccin-flavor 'mocha)
|
|
:config
|
|
(load-theme 'catppuccin t))
|
|
|
|
;; Icons are only useful in GUI Emacs.
|
|
(use-package all-the-icons
|
|
:if (display-graphic-p))
|
|
|
|
;; Color nested delimiters in programming buffers.
|
|
(use-package rainbow-delimiters
|
|
:hook (prog-mode . rainbow-delimiters-mode))
|
|
|
|
(use-package doom-modeline
|
|
:init
|
|
(doom-modeline-mode 1)
|
|
:config
|
|
(setq doom-modeline-height 15))
|
|
|
|
;;; Completion/Search/Navigation ---------------------------------------------
|
|
|
|
(use-package vertico
|
|
:init
|
|
(vertico-mode))
|
|
|
|
(use-package consult
|
|
:bind (("C-x b" . consult-buffer)
|
|
("C-s" . consult-line)
|
|
("M-y" . consult-yank-pop)))
|
|
|
|
(use-package orderless
|
|
:config
|
|
(setq completion-styles '(orderless basic)
|
|
completion-category-defaults nil))
|
|
|
|
(use-package marginalia
|
|
:init
|
|
(marginalia-mode))
|
|
|
|
(use-package embark
|
|
:bind (("C-." . embark-act)
|
|
("M-." . embark-dwim)))
|
|
|
|
(use-package embark-consult
|
|
:after (embark consult))
|
|
|
|
(use-package which-key
|
|
:init
|
|
(which-key-mode)
|
|
:config
|
|
(setq which-key-idle-delay 1))
|
|
|
|
;;; Key Bindings -------------------------------------------------------------
|
|
|
|
;; Make ESC quit prompts.
|
|
(global-set-key (kbd "<escape>") #'keyboard-escape-quit)
|
|
|
|
;; windmove: S-Arrow to move between windows (built-in since Emacs 27).
|
|
(windmove-default-keybindings)
|
|
|
|
;;; Projects -----------------------------------------------------------------
|
|
|
|
(use-package projectile
|
|
:init
|
|
(when (file-directory-p "~/src")
|
|
(setq projectile-project-search-path '("~/src")))
|
|
(setq projectile-switch-project-action #'projectile-dired)
|
|
:config
|
|
(projectile-mode 1)
|
|
:bind-keymap
|
|
("C-c p" . projectile-command-map))
|
|
|
|
(use-package consult-projectile
|
|
:bind (("C-c h" . consult-projectile)))
|
|
|
|
;;; Git ----------------------------------------------------------------------
|
|
|
|
(use-package magit
|
|
:commands (magit-status magit-get-current-branch)
|
|
:bind (("C-x g" . magit-status)
|
|
("C-x M-g" . magit-dispatch)
|
|
("C-c M-g" . magit-file-dispatch))
|
|
:custom
|
|
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
|
(magit-diff-refine-hunk t)
|
|
(magit-auto-revert-mode nil)
|
|
(magit-process-find-password-functions '(magit-process-password-auth-source)))
|
|
|
|
;;; Org ----------------------------------------------------------------------
|
|
|
|
(defun rh/org-mode-setup ()
|
|
(org-indent-mode)
|
|
(visual-line-mode 1))
|
|
|
|
(use-package org
|
|
:hook (org-mode . rh/org-mode-setup)
|
|
:config
|
|
(setq org-agenda-files
|
|
(if (file-directory-p "~/org")
|
|
(directory-files-recursively "~/org" "\\.org$")
|
|
nil)))
|
|
|
|
(rh/load-user-file "org-bindings.el")
|
|
(rh/load-user-file "common-dev-settings.el")
|
|
(rh/load-user-file "dev-settings.el")
|
|
(rh/load-user-file "latex-settings.el")
|
|
(rh/load-user-file "custom.el")
|