Split laptop/work into independent stow packages with shared/ base
- 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>
This commit is contained in:
77
shared/.config/emacs/common-dev-settings.el
Normal file
77
shared/.config/emacs/common-dev-settings.el
Normal file
@@ -0,0 +1,77 @@
|
||||
;;; common-dev-settings.el --- Dev tooling shared across all hosts
|
||||
|
||||
;;; Completion
|
||||
|
||||
(use-package company
|
||||
:defer 1
|
||||
:config
|
||||
(global-company-mode)
|
||||
(setq company-idle-delay 0.2
|
||||
company-minimum-prefix-length 2
|
||||
company-show-numbers t
|
||||
company-tooltip-align-annotations t))
|
||||
|
||||
;;; LSP
|
||||
|
||||
(use-package eglot
|
||||
:ensure nil
|
||||
:defer t
|
||||
:commands (eglot eglot-ensure)
|
||||
:config
|
||||
(setq eglot-autoshutdown t
|
||||
eglot-send-changes-idle-time 0.5)
|
||||
(setq eldoc-echo-area-use-multiline-p nil)
|
||||
(add-to-list 'eglot-stay-out-of 'eldoc))
|
||||
|
||||
;;; Tree-sitter mode management
|
||||
;; Grammar sources and installation are host-specific; see dev-settings.el.
|
||||
|
||||
(use-package treesit-auto
|
||||
:custom
|
||||
(treesit-auto-install 'prompt)
|
||||
:config
|
||||
(treesit-auto-add-to-auto-mode-alist 'all)
|
||||
(global-treesit-auto-mode))
|
||||
|
||||
;;; Utilities
|
||||
|
||||
(use-package helpful
|
||||
:defer t
|
||||
:commands (helpful-callable helpful-variable helpful-key))
|
||||
|
||||
(use-package smartparens
|
||||
:defer 1
|
||||
:hook (prog-mode . smartparens-mode)
|
||||
:config
|
||||
(require 'smartparens-config))
|
||||
|
||||
(use-package yasnippet
|
||||
:defer 2
|
||||
:config
|
||||
(yas-global-mode 1))
|
||||
|
||||
(use-package yasnippet-snippets
|
||||
:defer t
|
||||
:after yasnippet)
|
||||
|
||||
;;; Emacs Lisp
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook #'eldoc-mode)
|
||||
(add-hook 'emacs-lisp-mode-hook #'company-mode)
|
||||
|
||||
;;; LSP Keybindings
|
||||
|
||||
(with-eval-after-load 'eglot
|
||||
(keymap-set eglot-mode-map "C-c l d" #'xref-find-definitions)
|
||||
(keymap-set eglot-mode-map "C-c l r" #'xref-find-references)
|
||||
(keymap-set eglot-mode-map "C-c l i" #'eglot-find-implementation)
|
||||
(keymap-set eglot-mode-map "C-c l t" #'eglot-find-typeDefinition)
|
||||
(keymap-set eglot-mode-map "C-c l h" #'eldoc-doc-buffer)
|
||||
(keymap-set eglot-mode-map "C-c l s" #'eldoc)
|
||||
(keymap-set eglot-mode-map "C-c l a" #'eglot-code-actions)
|
||||
(keymap-set eglot-mode-map "C-c l n" #'eglot-rename)
|
||||
(keymap-set eglot-mode-map "C-c l e" #'flymake-show-buffer-diagnostics)
|
||||
(keymap-set eglot-mode-map "C-c l f" #'eglot-format-buffer))
|
||||
|
||||
(provide 'common-dev-settings)
|
||||
;;; common-dev-settings.el ends here
|
||||
159
shared/.config/emacs/init.el
Normal file
159
shared/.config/emacs/init.el
Normal file
@@ -0,0 +1,159 @@
|
||||
;; 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")
|
||||
35
shared/.config/emacs/org-bindings.el
Normal file
35
shared/.config/emacs/org-bindings.el
Normal file
@@ -0,0 +1,35 @@
|
||||
;;; org-bindings.el --- Standard Emacs keybindings for Org mode
|
||||
|
||||
(with-eval-after-load 'org
|
||||
;; Org agenda and capture
|
||||
(global-set-key (kbd "C-c o a") 'org-agenda)
|
||||
(global-set-key (kbd "C-c o c") 'org-capture)
|
||||
|
||||
;; Link commands
|
||||
(define-key org-mode-map (kbd "C-c o l") 'org-store-link)
|
||||
(define-key org-mode-map (kbd "C-c o i") 'org-insert-link)
|
||||
|
||||
;; TODO and scheduling
|
||||
(define-key org-mode-map (kbd "C-c o t") 'org-todo)
|
||||
(define-key org-mode-map (kbd "C-c o s") 'org-schedule)
|
||||
(define-key org-mode-map (kbd "C-c o d") 'org-deadline)
|
||||
(define-key org-mode-map (kbd "C-c o T") 'org-time-stamp)
|
||||
(define-key org-mode-map (kbd "C-c o p") 'org-priority)
|
||||
|
||||
;; Checkboxes and lists
|
||||
(define-key org-mode-map (kbd "C-c o x") 'org-toggle-checkbox)
|
||||
(define-key org-mode-map (kbd "C-c o -") 'org-ctrl-c-minus)
|
||||
|
||||
;; Refile
|
||||
(define-key org-mode-map (kbd "C-c o r") 'org-refile))
|
||||
|
||||
;; Theme selection
|
||||
(global-set-key (kbd "C-c t t") 'consult-theme)
|
||||
|
||||
;; Text scaling with standard Emacs bindings
|
||||
(global-set-key (kbd "C-x C-=") 'text-scale-increase)
|
||||
(global-set-key (kbd "C-x C--") 'text-scale-decrease)
|
||||
(global-set-key (kbd "C-x C-0") 'text-scale-adjust)
|
||||
|
||||
(provide 'org-bindings)
|
||||
;;; org-bindings.el ends here
|
||||
Reference in New Issue
Block a user