From 78de9847a94714666f48d85d52b0d9ca80424857 Mon Sep 17 00:00:00 2001 From: Joe Frikker Date: Mon, 16 Feb 2026 23:28:42 -0500 Subject: [PATCH] No more use-package --- home.org | 858 ++++++++++++++++++++++++------------------------------- 1 file changed, 371 insertions(+), 487 deletions(-) diff --git a/home.org b/home.org index cecd612..987d9ba 100644 --- a/home.org +++ b/home.org @@ -699,7 +699,6 @@ These are just some general settings that apply everywhere. First, a few package Turn off some default settings that I don't find useful. #+BEGIN_SRC elisp - ;;; -*- lexical-binding: t -*- (setq inhibit-startup-screen t) (setq initial-scratch-message nil) (menu-bar-mode -1) @@ -725,7 +724,7 @@ Automatically refresh ~dired~ buffers when switching to them, instead of requiri refresh. #+BEGIN_SRC elisp - (setq dired-auto-revert-buffer t) + (setopt dired-auto-revert-buffer t) #+END_SRC Similarly, highlighting the line the cursor is on is really useful for figuring out where you are, @@ -781,10 +780,10 @@ I have the tab bar at the top of the window. The other settings just clear up so things look at little nicer. #+BEGIN_SRC elisp - (setq doom-modeline-irc nil) - (setq doom-modeline-workspace-name nil) - (setq doom-modeline-buffer-encoding nil) - (setq doom-modeline-vcs-max-length 30) + (setopt doom-modeline-irc nil) + (setopt doom-modeline-workspace-name nil) + (setopt doom-modeline-buffer-encoding nil) + (setopt doom-modeline-vcs-max-length 30) (doom-modeline-mode) #+END_SRC @@ -793,24 +792,22 @@ cool, so I'm turning it on in prog mode. The enabled ligatures are font-specific ligature wiki]]. #+BEGIN_SRC elisp - (use-package ligature - :after prog-mode - :config - (ligature-set-ligatures 'prog-mode - '("--" "---" "==" "===" "!=" "!==" "=!=" - "=:=" "=/=" "<=" ">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!" - "??" "???" "?:" "?." "?=" "<:" ":<" ":>" ">:" "<:<" "<>" "<<<" ">>>" - "<<" ">>" "||" "-|" "_|_" "|-" "||-" "|=" "||=" "##" "###" "####" - "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#=" "^=" "<$>" "<$" - "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "" "/>" "" "->" "->>" "<<-" "<-" "<=<" "=<<" "<<=" "<==" "<=>" "<==>" - "==>" "=>" "=>>" ">=>" ">>=" ">>-" ">-" "-<" "-<<" ">->" "<-<" "<-|" - "<=|" "|=>" "|->" "<->" "<~~" "<~" "<~>" "~~" "~~>" "~>" "~-" "-~" - "~@" "[||]" "|]" "[|" "|}" "{|" "[<" ">]" "|>" "<|" "||>" "<||" - "|||>" "<|||" "<|>" "..." ".." ".=" "..<" ".?" "::" ":::" ":=" "::=" - ":?" ":?>" "//" "///" "/*" "*/" "/=" "//=" "/==" "@_" "__" "???" - "<:<" ";;;")) - (global-ligature-mode t)) + (require 'ligature) + (ligature-set-ligatures 'prog-mode + '("--" "---" "==" "===" "!=" "!==" "=!=" + "=:=" "=/=" "<=" ">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!" + "??" "???" "?:" "?." "?=" "<:" ":<" ":>" ">:" "<:<" "<>" "<<<" ">>>" + "<<" ">>" "||" "-|" "_|_" "|-" "||-" "|=" "||=" "##" "###" "####" + "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#=" "^=" "<$>" "<$" + "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "" "/>" "" "->" "->>" "<<-" "<-" "<=<" "=<<" "<<=" "<==" "<=>" "<==>" + "==>" "=>" "=>>" ">=>" ">>=" ">>-" ">-" "-<" "-<<" ">->" "<-<" "<-|" + "<=|" "|=>" "|->" "<->" "<~~" "<~" "<~>" "~~" "~~>" "~>" "~-" "-~" + "~@" "[||]" "|]" "[|" "|}" "{|" "[<" ">]" "|>" "<|" "||>" "<||" + "|||>" "<|||" "<|>" "..." ".." ".=" "..<" ".?" "::" ":::" ":=" "::=" + ":?" ":?>" "//" "///" "/*" "*/" "/=" "//=" "/==" "@_" "__" "???" + "<:<" ";;;")) + (global-ligature-mode t) #+END_SRC Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blocks as monospace. @@ -828,22 +825,20 @@ Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blo A basic ace-window setup. Allows switching between windows quickly (although avy can do the same...). #+BEGIN_SRC elisp - (use-package ace-window - :bind (("M-o" . ace-window) - ("s-o" . ace-window)) - :config - (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) - (setq aw-dispatch-always t)) + (require 'ace-window) + (bind-keys ("M-o" . ace-window) + ("s-o" . ace-window)) + (setopt aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) + (setopt aw-dispatch-always t) #+END_SRC Set up a few project- / workspace-related key bindings. -#+name: workspace_keybinds #+BEGIN_SRC elisp - (bind-keys ("s-f" . project-find-file) - ("s-F" . project-switch-project)) - (bind-keys :map tab-bar-mode-map - ("s-s" . tab-bar-switch-to-tab)) + (bind-keys ("s-f" . project-find-file) + ("s-F" . project-switch-project)) + (bind-keys :map tab-bar-mode-map + ("s-s" . tab-bar-switch-to-tab)) #+END_SRC Don't run a server. I'm not using this, I can always turn it back on if I need to. @@ -874,13 +869,12 @@ change when drilling into a help page or something. I've set up repeat mode to m move backward / forward through history. #+BEGIN_SRC elisp - (use-package tab-bar - :config - (tab-bar-history-mode) - (defvar-keymap tab-bar-repeat-map - :repeat t - "" #'tab-bar-history-back - "" #'tab-bar-history-forward)) + (require 'tab-bar) + + (bind-keys :repeat-map tab-bar-repeat-map + ("" . tab-bar-history-back) + ("" . tab-bar-history-forward)) + (tab-bar-history-mode) #+END_SRC *** Window Placement @@ -950,7 +944,6 @@ This configuration affects general text editing, across all modes. First, some p enable = true; extraPackages = epkgs: with epkgs; [ avy - devil edit-indirect embark god-mode @@ -972,7 +965,7 @@ but I'm worried that having too many repeat maps will also be annoying (I'll hav cancel them more frequently). In the end, I opted for Devil mode. It avoids modifier keys, and has its own devil-mode-only repeat maps that don't interfere when using normal modifier key sequences. -#+BEGIN_SRC elisp +#+BEGIN_SRC elisp :tangle nil (use-package devil :disable t :config @@ -988,21 +981,24 @@ its own devil-mode-only repeat maps that don't interfere when using normal modif ("%k p" "%k n" "%k b" "%k f" "%k a" "%k e") ("%k s") ("%k m d" "%k m ")))) +#+END_SRC - (use-package god-mode - :config - (bind-keys :map god-local-mode-map - ("i" . (lambda () (interactive) (god-mode-all -1))) - ("z" . repeat)) - (bind-keys ("" . (lambda () (interactive) (god-mode-all 1)))) - (defun my-god-mode-update-cursor-type () - (setq cursor-type (cond - (org-present-mode nil) - ((or god-local-mode buffer-read-only) 'box) - (t 'bar)))) +#+BEGIN_SRC elisp + (require 'god-mode) + (require 'which-key) - (add-hook 'post-command-hook 'my-god-mode-update-cursor-type) - (which-key-enable-god-mode-support)) + (bind-keys :map god-local-mode-map + ("i" . (lambda () (interactive) (god-mode-all -1))) + ("z" . repeat)) + (bind-keys ("" . (lambda () (interactive) (god-mode-all 1)))) + (defun my-god-mode-update-cursor-type () + (setq cursor-type (cond + (org-present-mode nil) + ((or god-local-mode buffer-read-only) 'box) + (t 'bar)))) + + (add-hook 'post-command-hook 'my-god-mode-update-cursor-type) + (which-key-enable-god-mode-support) #+END_SRC Avy allows jumping to any place on the screen with just a few keystrokes. I've stolen most of these @@ -1010,13 +1006,11 @@ ideas from Karthinks' article [[https://karthinks.com/software/avy-can-do-anythi his article. #+BEGIN_SRC elisp - (use-package avy - :bind ("M-j" . avy-goto-char-timer)) + (require 'avy) + (require 'embark) (defun avy-goto-char-timer-embark () (interactive) - (require 'avy) - (require 'embark) (let ((avy-action-oneshot (lambda (pt) (unwind-protect @@ -1028,49 +1022,39 @@ his article. (avy-goto-char-timer))) (bind-keys - ("M-J" . avy-goto-char-timer-embark)) - - (use-package embark - :bind - (("C-." . embark-act) ;; pick some comfortable binding - )) - + ("M-j" . avy-goto-char-timer) + ("M-J" . avy-goto-char-timer-embark) + ("C-." . embark-act)) #+END_SRC Just "silently" wrap when searching at the bottom of a document. #+BEGIN_SRC elisp - (use-package isearch - :custom - (isearch-wrap-pause 'no-ding)) + (setopt isearch-wrap-pause 'no-ding) #+END_SRC #+BEGIN_SRC elisp - (use-package string-inflection - :commands - string-inflection-java-style-cycle - string-inflection-rust-style-cycle - :config - (defun string-inflection-rust-style-cycle-function (str) - (cond - ((string-inflection-snake-case-p str) - (string-inflection-upcase-function str)) - ((string-inflection-upcase-p str) - (string-inflection-pascal-case-function str)) - (t - (string-inflection-snake-case-function str)))) - (defun string-inflection-rust-style-cycle () - (interactive) - (string-inflection--symbol-or-region #'string-inflection-rust-style-cycle-function)) - (defvar-keymap string-inflection-java-map - :repeat t - "u" #'string-inflection-java-style-cycle) - (defvar-keymap string-inflection-rust-map - :repeat t - "u" #'string-inflection-rust-style-cycle)) + (require 'string-inflection) + (defun string-inflection-rust-style-cycle-function (str) + (cond + ((string-inflection-snake-case-p str) + (string-inflection-upcase-function str)) + ((string-inflection-upcase-p str) + (string-inflection-pascal-case-function str)) + (t + (string-inflection-snake-case-function str)))) - (use-package edit-indirect - :bind ("C-x 4 n" . edit-indirect-region)) + (defun string-inflection-rust-style-cycle () + (interactive) + (string-inflection--symbol-or-region #'string-inflection-rust-style-cycle-function)) + + (bind-keys :repeat-map string-inflection-java-map + ("u" . string-inflection-java-style-cycle)) + + (bind-keys :repeat-map string-inflection-rust-map + ("u" . string-inflection-rust-style-cycle)) + + (bind-keys ("C-x 4 n" . edit-indirect-region)) #+END_SRC ** Language Support @@ -1078,7 +1062,7 @@ Just "silently" wrap when searching at the bottom of a document. :header-args:elisp: :tangle target/emacs-languages.el :END: -#+BEGIN_SRC nix +#+BEGIN_SRC nix :tangle target/emacs-languages.nix { programs.emacs = { enable = true; @@ -1090,7 +1074,6 @@ Just "silently" wrap when searching at the bottom of a document. lua-mode nix-mode rust-mode - smartparens sly sly-macrostep sql-indent @@ -1109,167 +1092,130 @@ available? It seems to work for now anyway... #+BEGIN_SRC elisp (electric-pair-mode 1) - - (use-package prog-mode - :config - (defun prog-fill-reindent-defun (&optional argument) - "Refill or reindent the paragraph or defun that contains point. + + (require 'prog-mode) + (defun my-prog-fill-reindent-defun (&optional argument) + "Refill or reindent the paragraph or defun that contains point. If the point is in a string or a comment, fill the paragraph that contains point or follows point. Otherwise, reindent the function definition that contains point or follows point." - (interactive "P") - (save-excursion - (let ((treesit-text-node - (and (treesit-available-p) - (treesit-parser-list) - (treesit-node-match-p - (treesit-node-at (point)) 'text t)))) - (if (or treesit-text-node - (and (not (and (treesit-available-p) (treesit-parser-list))) (nth 8 (syntax-ppss))) - (re-search-forward "\\s-*\\s<" (line-end-position) t)) - (fill-paragraph argument (region-active-p)) - (beginning-of-defun) - (let ((start (point))) - (end-of-defun) - (indent-region start (point) nil))))))) -#+END_SRC + (interactive "P") + (save-excursion + (let ((treesit-text-node + (and (treesit-available-p) + (treesit-parser-list) + (treesit-node-match-p + (treesit-node-at (point)) 'text t)))) + (if (or treesit-text-node + (and (not (and (treesit-available-p) (treesit-parser-list))) (nth 8 (syntax-ppss))) + (re-search-forward "\\s-*\\s<" (line-end-position) t)) + (fill-paragraph argument (region-active-p)) + (beginning-of-defun) + (let ((start (point))) + (end-of-defun) + (indent-region start (point) nil)))))) -#+BEGIN_SRC elisp - (use-package nix-mode - :mode "\\.nix\\'") + (advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun) - (use-package nix-flake - :bind ("C-x p n" . project-nix-flake) - :config - (defun project-nix-flake () - (interactive) - (nix-flake (project-root (project-current t))))) - - (use-package lua-mode - :mode "\\.lua\\'") - - (use-package jenkinsfile-mode - :mode "\\.jenkinsfile\\'") - - (setq major-mode-remap-alist '((rust-mode . rust-mode))) - - (use-package rust-mode - :init (setq rust-mode-treesitter-derive t)) - - (defun yaml-validate () - (interactive) - (compile (concat "yamllint -d '{extends: default, rules: {indentation: {indent-sequences: false}, braces: {max-spaces-inside: 1}}}' " (buffer-file-name)) t)) - - (use-package yaml-ts-mode - :mode "\\.yaml\\'") - - (use-package yaml-pro - :hook (yaml-ts-mode . yaml-pro-ts-mode)) - - (use-package sly - :hook lisp-mode-hook - :custom - (inferior-lisp-program "sbcl")) - - (use-package sly-macrostep - :defer t - :after sly - :init - (add-to-list 'sly-contribs 'sly-macrostep)) - - (use-package consult-eglot - :commands - consult-eglot-symbols) - - (use-package typescript-ts-mode - :mode "\\.ts\\'" ("\\.tsx\\'" . tsx-ts-mode) - :custom - (typescript-ts-mode-indent-offset 4) - (defun tsx-ts-mode--indent-compatibility-b893426 () - "Indent rules helper, to handle different releases of tree-sitter-tsx. - Check if a node type is available, then return the right indent rules." - ;; handle https://github.com/tree-sitter/tree-sitter-typescript/commit/b893426b82492e59388a326b824a346d829487e8 - (condition-case nil - (progn (treesit-query-capture 'tsx '((jsx_fragment) @capture)) - `(((match "<" "jsx_fragment") parent 0) - ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset))) - (treesit-query-error - `(((match "<" "jsx_text") parent 0) - ((parent-is "jsx_text") grand-parent typescript-ts-mode-indent-offset)))))) - - (use-package rust-ts-mode - :mode "\\.rs\\'" - :config - (bind-keys :map rust-ts-mode-map - ("C-c u" . string-inflection-rust-style-cycle))) - - (use-package java-ts-mode - :mode "\\.java\\'" - :config - (bind-keys :map java-ts-mode-map - ("C-c u" . string-inflection-java-style-cycle)) - (push `((n-p-gp nil "block" "lambda_expression") parent-bol java-ts-mode-indent-offset) - (cdar java-ts-mode--indent-rules)) - (push `((n-p-gp "}" "block" "lambda_expression") parent-bol 0) - (cdar java-ts-mode--indent-rules))) - - (use-package sql-indent - :hook (sql-mode-hook . sqlind-minor-mode)) - - (use-package haskell-ts-mode - :mode "\\.hs\\'" - :custom (haskell-ts-use-indent tc)) - - (use-package flymake - :bind - (:map prog-mode-map - ("C-c D" . flymake-show-project-diagnostics) - ("M-n" . flymake-goto-next-error) - ("M-p" . flymake-goto-prev-error))) - - (use-package eglot - :commands eglot - :custom - (eglot-ignored-server-capabilities '(:inlayHintProvider)) - :config - (bind-keys :map eglot-mode-map - ("C-c A" . eglot-code-actions) - ("C-c R" . eglot-rename) - ("C-c I" . eglot-find-implementation)) - - (add-hook 'eglot-managed-mode-hook (lambda () (eglot-inlay-hints-mode -1)) nil t)) - - (use-package lispy - :hook (emacs-lisp-mode lisp-mode) - :init (setq lispy-compat '(god-mode edebug)) - :config - (bind-keys :map lispy-mode-map - ("i" . (lambda () - (interactive) - (if god-global-mode - (god-mode-all -1) - (special-lispy-tab)))))) - - (use-package smartparens - :hook - emacs-lisp-mode - common-lisp-mode - :config - (add-to-list 'sp-lisp-modes 'sly-mrepl-mode) - (require 'smartparens-config) - (setq sp-highlight-pair-overlay nil - sp-highlight-wrap-overlay nil - sp-highlight-wrap-tag-overlay nil)) + (require 'flymake) + (bind-keys :map prog-mode-map + ("C-c D" . flymake-show-project-diagnostics) + ("M-n" . flymake-goto-next-error) + ("M-p" . flymake-goto-prev-error)) (setq-default indent-tabs-mode nil) (setq-default tab-width 4) (global-tree-sitter-mode 1) (setq-default fill-column 100) + (defun jf-init-fill-column () (display-fill-column-indicator-mode 1)) + (add-hook 'prog-mode-hook 'jf-init-fill-column) + + (setopt eglot-ignored-server-capabilities '(:inlayHintProvider)) + (add-hook 'eglot-managed-mode-hook (lambda () (eglot-inlay-hints-mode -1)) nil t) + (require 'eglot) + (bind-keys :map eglot-mode-map + ("C-c A" . eglot-code-actions) + ("C-c R" . eglot-rename) + ("C-c I" . eglot-find-implementation)) + + (setopt ediff-split-window-function 'split-window-horizontally) + + (defun project-nix-flake () + (interactive) + (nix-flake (project-root (project-current t)))) + (bind-keys ("C-x p n" . project-nix-flake)) + #+END_SRC + +*** Rust +#+BEGIN_SRC elisp + ;; (setq major-mode-remap-alist '((rust-mode . rust-mode))) + + (setopt rust-mode-treesitter-derive t) + + (require 'rust-ts-mode) + (bind-keys :map rust-ts-mode-map + ("C-c u" . string-inflection-rust-style-cycle)) +#+END_SRC + +*** YAML +#+BEGIN_SRC elisp + (defun yaml-validate () + (interactive) + (compile (concat "yamllint -d '{extends: default, rules: {indentation: {indent-sequences: false}, braces: {max-spaces-inside: 1}}}' " (buffer-file-name)) t)) + + (add-hook 'yaml-ts-mode-hook 'yaml-pro-ts-mode) +#+END_SRC + +*** Lisp +#+BEGIN_SRC elisp + (setopt inferior-lisp-program "sbcl") + + (setopt lispy-compat '(god-mode edebug)) + (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))) + (add-hook 'lisp-mode-hook (lambda () (lispy-mode 1))) + (require 'lispy) + (bind-keys :map lispy-mode-map + ("i" . (lambda () + (interactive) + (if god-global-mode + (god-mode-all -1) + (special-lispy-tab))))) +#+END_SRC + +*** Typescript +#+BEGIN_SRC elisp + (setopt typescript-ts-mode-indent-offset 4) + (require 'typescript-ts-mode) + (defun my-tsx-ts-mode--indent-compatibility-b893426 () + "Indent rules helper, to handle different releases of tree-sitter-tsx. + Check if a node type is available, then return the right indent rules." + ;; handle https://github.com/tree-sitter/tree-sitter-typescript/commit/b893426b82492e59388a326b824a346d829487e8 + (condition-case nil + (progn (treesit-query-capture 'tsx '((jsx_fragment) @capture)) + `(((match "<" "jsx_fragment") parent 0) + ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset))) + (treesit-query-error + `(((match "<" "jsx_text") parent 0) + ((parent-is "jsx_text") grand-parent typescript-ts-mode-indent-offset))))) + (advice-add 'tsx-ts-mode--indent-compatibility-b893426 :override #'my-tsx-ts-mode--indent-compatibility-b893426) +#+END_SRC + +*** Java +#+BEGIN_SRC elisp + (require 'java-ts-mode) + (bind-keys :map java-ts-mode-map + ("C-c u" . string-inflection-java-style-cycle)) + (push `((n-p-gp nil "block" "lambda_expression") parent-bol java-ts-mode-indent-offset) + (cdar java-ts-mode--indent-rules)) + (push `((n-p-gp "}" "block" "lambda_expression") parent-bol 0) + (cdar java-ts-mode--indent-rules)) + + (add-hook 'java-mode-hook (lambda () (c-set-offset 'arglist-intro '+))) (defvar jf/class-name-to-file-search-path (list "src/main/java" "src/test/java")) @@ -1291,21 +1237,16 @@ available? It seems to work for now anyway... ; ("^[[:space:]]*at \\(\\(?:[[:lower:]]+\\.\\)+\\)[^(]+(\\([[:alnum:]]+\\)\\.java:\\([[:digit:]]+\\))" ; jf/compile-class-to-file 3))) ;(add-to-list 'compilation-error-regexp-alist 'java-stack-trace) +#+END_SRC - (add-hook 'prog-mode-hook 'jf-init-fill-column) - (add-hook 'java-mode-hook (lambda () (c-set-offset 'arglist-intro '+))) +*** SQL +#+BEGIN_SRC elisp + (add-hook 'sql-mode-hook 'sqlind-minor-mode) +#+END_SRC - ;; (dolist (hook - ;; (list 'grep-mode-hook - ;; 'flymake-project-diagnostics-mode-hook - ;; 'xref--xref-buffer-mode-hook - ;; 'embark-collect-mode-hook - ;; 'compilation-mode-hook - ;; 'sly-mrepl-mode-hook - ;; 'eglot-list-connections-mode-hook)) - ;; (add-hook hook 'tab-line-mode)) - - (setq ediff-split-window-function 'split-window-horizontally) +*** Haskell +#+BEGIN_SRC elisp + (setopt haskell-ts-use-indent t) #+END_SRC ** Envrc @@ -1326,10 +1267,8 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package envrc - :hook (after-init . envrc-global-mode) - :custom - (envrc-show-summary-in-minibuffer nil)) + (add-hook 'after-init-hook 'envrc-global-mode) + (setopt envrc-show-summary-in-minibuffer nil) #+END_SRC ** Magit @@ -1354,34 +1293,26 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package magit - :defer nil - :bind (("C-x g" . magit-status) - ("s-g" . magit-status) - ("C-x M-g" . magit-dispatch) - ("C-c M-g" . magit-file-dispatch)) - :custom - (magit-save-repository-buffers 'dontask) - (magit-commit-show-diff nil) - :config + (setopt magit-define-global-key-bindings 'recommended) + (bind-keys ("s-g" . magit-status)) + + (setopt magit-save-repository-buffers 'dontask) + (setopt magit-commit-show-diff nil) + (with-eval-after-load 'magit (set-face-attribute 'git-commit-summary nil :inherit nil) (defun magit-fetch-all-on-load () (magit-run-git-async "fetch" "--all")) (add-hook 'magit-status-mode-hook 'magit-fetch-all-on-load) - (remove-hook 'magit-status-headers-hook 'magit-insert-tags-header)) - - (use-package forge - :after magit - :custom - (forge-edit-post-hook '(forge-create-pullreq-insert-single-commit-message)) - (forge-status-buffer-default-topic-filters - (forge--topics-spec :type 'topic :active nil :state 'open :order 'newest))) - - (use-package diff-hl - :after magit - :config - (global-diff-hl-mode) + (remove-hook 'magit-status-headers-hook 'magit-insert-tags-header) + (require 'forge) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)) + + (with-eval-after-load 'forge + (add-hook 'forge-edit-post-hook 'forge-create-pullreq-insert-single-commit-message) + (setopt forge-status-buffer-default-topic-filters + (forge--topics-spec :type 'topic :active nil :state 'open :order 'newest))) + + (global-diff-hl-mode) #+END_SRC ** Vertico @@ -1408,105 +1339,86 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package consult - :bind ( - ;; ("C-c M-x" . consult-mode-command) - ("C-c h" . consult-history) - ;; ("C-c k" . consult-kmacro) - ;; ("C-c m" . consult-man) - ;; ([remap Info-search] . consult-info) + (bind-keys + ;; ("C-c M-x" . consult-mode-command) + ("C-c h" . consult-history) + ;; ("C-c k" . consult-kmacro) + ;; ("C-c m" . consult-man) + ;; ([remap Info-search] . consult-info) - ;; ("C-x M-:" . consult-complex-command) - ("C-x b" . consult-buffer) - ("s-b" . consult-project-buffer) - ("s-B" . consult-buffer) - ("C-x 4 b" . consult-buffer-other-window) - ("C-x 5 b" . consult-buffer-other-frame) - ("C-x t b" . consult-buffer-other-tab) - ("C-x r b" . consult-bookmark) - ("C-x p b" . consult-project-buffer) + ;; ("C-x M-:" . consult-complex-command) + ("C-x b" . consult-buffer) + ("s-b" . consult-project-buffer) + ("s-B" . consult-buffer) + ("C-x 4 b" . consult-buffer-other-window) + ("C-x 5 b" . consult-buffer-other-frame) + ("C-x t b" . consult-buffer-other-tab) + ("C-x r b" . consult-bookmark) + ("C-x p b" . consult-project-buffer) - ("M-#" . consult-register-load) - ("M-'" . consult-register-store) - ("C-M-#" . consult-register) - ("M-y" . consult-yank-pop) - ("M-g e" . consult-compile-error) - ("M-g f" . consult-flymake) - ("M-g g" . consult-goto-line) - ("M-g M-g" . consult-goto-line) - ("M-g o" . consult-org-heading) - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark) - ("M-g i" . consult-imenu) - ("M-g I" . consult-imenu-multi) - ("M-s r" . consult-ripgrep) - ("M-s l" . consult-line) - ("M-s L" . consult-line-multi) - ("M-s e" . consult-isearch-history) - :map isearch-mode-map - ("M-e" . consult-isearch-history) - ("M-s e" . consult-isearch-history) - ("M-s l" . consult-line) - ("M-s L" . consult-line-multi) - :map minibuffer-local-map - ("M-s" . consult-history) - ("M-r" . consult-history)) - :hook (completion-list-mode . consult-preview-at-point-mode) - :init - (advice-add #'register-preview :override #'consult-register-window) - (setq register-preview-delay 0.5) + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) + ("C-M-#" . consult-register) + ("M-y" . consult-yank-pop) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) + ("M-g g" . consult-goto-line) + ("M-g M-g" . consult-goto-line) + ("M-g o" . consult-org-heading) + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-imenu-multi) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s e" . consult-isearch-history) + :map isearch-mode-map + ("M-e" . consult-isearch-history) + ("M-s e" . consult-isearch-history) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + :map minibuffer-local-map + ("M-s" . consult-history) + ("M-r" . consult-history)) - (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) + (add-hook 'completion-list-mode-hook 'consult-preview-at-point-mode) - :config + (advice-add 'register-preview :override #'consult-register-window) + (setopt register-preview-delay 0.5) - (consult-customize - consult-theme :preview-key '(:debounce 0.2 any) - consult-ripgrep consult-git-grep consult-grep consult-man - consult-bookmark consult-recent-file consult-xref - consult--source-bookmark consult--source-file-register - consult--source-recent-file consult--source-project-recent-file - ;; :preview-key "M-." - :preview-key '(:debounce 0.4 any)) + (setopt xref-show-xrefs-function 'consult-xref) + (setopt xref-show-definitions-function 'consult-xref) - (setq consult-narrow-key "<") ;; "C-+" - ) + (require 'consult) + (consult-customize + consult-theme :preview-key '(:debounce 0.2 any) + consult-ripgrep consult-git-grep consult-grep consult-man + consult-bookmark consult-recent-file consult-xref + consult--source-bookmark consult--source-file-register + consult--source-recent-file consult--source-project-recent-file + ;; :preview-key "M-." + :preview-key '(:debounce 0.4 any)) - (use-package vertico - :custom - (vertico-count 25) - :config - (vertico-mode)) + (setopt consult-narrow-key "<") ;; "C-+" - ;; (use-package vertico-buffer - ;; :after vertico - ;; :config - ;; (vertico-buffer-mode)) + (setopt vertico-count 25) + (vertico-mode) - (use-package orderless - :custom - (completion-styles '(orderless basic))) + (setopt completion-styles '(orderless basic)) - (use-package marginalia - :config - (marginalia-mode)) + (marginalia-mode) - (use-package corfu - :custom - (corfu-cycle t) - (corfu-popupinfo-mode) - (corfu-quit-at-boundary nil) - (corfu-on-exact-match 'show) - :config - (global-corfu-mode)) + (setopt corfu-cycle t) + (setopt corfu-popupinfo-mode nil) + (setopt corfu-quit-at-boundary nil) + (setopt corfu-on-exact-match 'show) + (global-corfu-mode) ;; Consult users will also want the embark-consult package. - (use-package embark-consult - :hook (embark-collect-mode . consult-preview-at-point-mode)) + (add-hook 'embark-collect-mode-hook 'consult-preview-at-point-mode) - (use-package cape - :config - (add-hook 'completion-at-point-functions #'cape-file)) + (add-hook 'completion-at-point-functions 'cape-file) #+END_SRC ** Org @@ -1532,23 +1444,14 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package org - :defer nil - :mode ("\\.org\\'" . org-mode) - :bind (("C-c a" . org-agenda) - ("C-c c" . org-capture) - ("C-c l" . org-store-id-link)) - :config - (add-hook 'org-mode-hook 'visual-line-mode) - (setq org-link-keep-stored-after-insertion t - org-todo-keywords - '((sequence - "TODO(o)" - "IN_PROGRESS(p!)" - "WAITING(w@)" - "|" - "DONE(d!)" - "CANCELLED(c@)")) + (require 'org) + + (bind-keys ("C-c a" . org-agenda) + ("C-c c" . org-capture) + ("C-c l" . org-id-store-link)) + + (add-hook 'org-mode-hook 'visual-line-mode) + (setopt org-link-keep-stored-after-insertion t org-capture-templates '(("t" "Todo" entry (here) @@ -1572,90 +1475,86 @@ available? It seems to work for now anyway... org-agenda-tags-todo-honor-ignore-options t org-enforce-todo-dependencies t org-agenda-dim-blocked-tasks 'invisible) - (set-face-attribute 'org-level-1 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-2 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-3 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-4 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-5 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-6 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-7 nil :font "Iosevka Aile") - (set-face-attribute 'org-level-8 nil :font "Iosevka Aile")) + (set-face-attribute 'org-level-1 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-2 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-3 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-4 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-5 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-6 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-7 nil :font "Iosevka Aile") + (set-face-attribute 'org-level-8 nil :font "Iosevka Aile") - (use-package org-present - :defer nil - :commands (org-present) - :config - (defun my/org-present-start () - (setq-local my/org-present-face-remapping-cookies nil) - ;; Tweak font sizes - (dolist (face '((default :height 2.0) - (header-line :height 4.0 :background "#303446") - (org-document-title :height 1.75) - (org-code :height 2.0) - (org-verbatim :height 2.0) - (org-block :height 1.25) - (org-block-begin-line :height 0.7) - (org-level-1 :height 3.0) - (org-level-2 :height 3.0) - (org-level-3 :height 3.0) - (org-level-4 :height 3.0) - (org-level-5 :height 3.0) - (org-level-6 :height 3.0) - (org-level-7 :height 3.0) - (org-level-8 :height 3.0))) - (push (apply #'face-remap-add-relative face) my/org-present-face-remapping-cookies)) - - ;; Set a blank header line string to create blank space at the top - (setq header-line-format " ") + (require 'org-present) + (require 'face-remap) + (require 'visual-fill-column) - ;; Display inline images automatically - (org-display-inline-images) - (org-present-hide-cursor) + (defvar-local my/org-present-face-remapping-cookies nil) + (defun my/org-present-start () + (setq-local my/org-present-face-remapping-cookies nil) + ;; Tweak font sizes + (dolist (face '((default :height 2.0) + (header-line :height 4.0 :background "#303446") + (org-document-title :height 1.75) + (org-code :height 2.0) + (org-verbatim :height 2.0) + (org-block :height 1.25) + (org-block-begin-line :height 0.7) + (org-level-1 :height 3.0) + (org-level-2 :height 3.0) + (org-level-3 :height 3.0) + (org-level-4 :height 3.0) + (org-level-5 :height 3.0) + (org-level-6 :height 3.0) + (org-level-7 :height 3.0) + (org-level-8 :height 3.0))) + (push (apply #'face-remap-add-relative face) my/org-present-face-remapping-cookies)) + + ;; Set a blank header line string to create blank space at the top + (setq header-line-format " ") - ;; Center the presentation and wrap lines - (visual-fill-column-mode 1) - (setq visual-fill-column-center-text t) - ;; (visual-line-mode 1) - ) + ;; Display inline images automatically + (org-display-inline-images) + (org-present-hide-cursor) - (defun my/org-present-end () - ;; Reset font customizations - (dolist (cookie my/org-present-face-remapping-cookies) - (face-remap-remove-relative cookie)) - - ;; Clear the header line string so that it isn't displayed - (setq header-line-format nil) + ;; Center the presentation and wrap lines + (visual-fill-column-mode 1) + (setq visual-fill-column-center-text t) + ;; (visual-line-mode 1) + ) - ;; Stop displaying inline images - (org-remove-inline-images) - (org-present-show-cursor) + (defun my/org-present-end () + ;; Reset font customizations + (dolist (cookie my/org-present-face-remapping-cookies) + (face-remap-remove-relative cookie)) + + ;; Clear the header line string so that it isn't displayed + (setq header-line-format nil) - ;; Stop centering the document - (visual-fill-column-mode 0) - ;; (visual-line-mode 0) - ) + ;; Stop displaying inline images + (org-remove-inline-images) + (org-present-show-cursor) - (add-hook 'org-present-mode-hook 'my/org-present-start) - (add-hook 'org-present-mode-quit-hook 'my/org-present-end)) + ;; Stop centering the document + (visual-fill-column-mode 0) + ;; (visual-line-mode 0) + ) - (use-package org-roam - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n g" . org-roam-graph) - ("C-c n i" . org-roam-node-insert) - ("C-c n c" . org-roam-capture)) - :config - ;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) - (org-roam-db-autosync-mode)) + (add-hook 'org-present-mode-hook 'my/org-present-start) + (add-hook 'org-present-mode-quit-hook 'my/org-present-end) - (use-package org-modern - :hook org-mode-hook) + (require 'org-roam) + (bind-keys ("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n g" . org-roam-graph) + ("C-c n i" . org-roam-node-insert) + ("C-c n c" . org-roam-capture)) - (use-package verb - :after org - :bind-keymap - (:map org-mode-map - ("C-c C-r" . verb-command-map))) + ;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) + (org-roam-db-autosync-mode) + + (add-hook 'org-mode-hook 'org-modern-mode) + + (define-key org-mode-map (kbd "C-c C-r") verb-command-map) #+END_SRC ** Terminal @@ -1676,9 +1575,7 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package eat - :config - (eat-eshell-mode)) + (eat-eshell-mode) #+END_SRC ** Slack @@ -1686,7 +1583,7 @@ available? It seems to work for now anyway... :header-args:elisp: :tangle target/emacs-slack.el :END: -#+BEGIN_SRC nix +#+BEGIN_SRC nix :tangle target/emacs-slack.nix { programs.emacs = { enable = true; @@ -1694,22 +1591,14 @@ available? It seems to work for now anyway... slack ]; extraConfig = builtins.readFile ./emacs-slack.el; - } + }; } #+END_SRC #+BEGIN_SRC elisp - (use-package lui - :defer t - :custom - (lui-time-stamp-format "[%Y-%m-%d %H:%M]")) - - (use-package slack - :commands - slack-start - :custom - (slack-render-profile-images-p nil) - (slack-buffer-function #'switch-to-buffer())) + (setopt lui-time-stamp-format "[%Y-%m-%d %H:%M]") + (setopt slack-render-profile-images-p nil) + (setopt slack-buffer-function #'switch-to-buffer) #+END_SRC ** Kubernetes @@ -1766,13 +1655,10 @@ available? It seems to work for now anyway... #+END_SRC #+BEGIN_SRC elisp - (use-package age - :custom - (age-default-identity "~/source/dotfiles/keys/yubi1age.txt") - (age-default-recipient "~/source/dotfiles/keys/myself.txt") - :config - (setenv "PINENTRY_PROGRAM" "pinentry-mac") - (age-file-enable)) + (setopt age-default-identity "~/source/dotfiles/keys/yubi1age.txt") + (setopt age-default-recipient "~/source/dotfiles/keys/myself.txt") + (setenv "PINENTRY_PROGRAM" "pinentry-mac") + (age-file-enable) #+END_SRC * Theme @@ -1882,11 +1768,9 @@ I like Catppuccin Frappe as my theme. Let's use it in as many places as we can. #+END_SRC #+BEGIN_SRC elisp - (use-package catppuccin-theme - :custom - (catppuccin-flavor 'frappe) - :config - (load-theme 'catppuccin :no-confirm)) + (require 'catppuccin-theme) + (setopt catppuccin-flavor 'frappe) + (load-theme 'catppuccin :no-confirm) ;; (set-face-attribute 'default nil :font "JetBrainsMono Nerd Font" :height 130) ;; (set-face-attribute 'fixed-pitch nil :font "JetBrainsMono Nerd Font" :height 130)