Created
July 1, 2025 10:15
-
-
Save iarenaza/ad2f19252ff33148902081a8e8317784 to your computer and use it in GitHub Desktop.
Emacs configuration with straigth.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; early-init.el --- Iñaki Arenaza's Emacs early init configuration file | |
| ;;; | |
| ;;; Commentary: | |
| ;;; | |
| ;;; Bits and pieces shamelessly stolen from various places. | |
| ;;; | |
| ;;; Code: | |
| ;;;; --- Custom early init file per Emacs major version ------------------------ | |
| (let ((init-file (expand-file-name (format "emacs-%s.early-init.el" emacs-major-version) | |
| user-emacs-directory))) | |
| (load init-file)) | |
| ;;; early-init.el ends here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; emacs-30-early-init.el --- Iñaki Arenaza's Emacs early init configuration file | |
| ;;; | |
| ;;; Commentary: | |
| ;;; | |
| ;;; Bits and pieces shamelessly stolen from various places. | |
| ;;; | |
| ;;; Code: | |
| ;;;;; --- Disable package.el startup ------------------------------------------- | |
| ;; Prevent package.el from loading packages prior to their init-file | |
| ;; loading. Otherwise it clashes with straight.el | |
| (setq package-enable-at-startup nil) | |
| ;;; emacs-30-early-init.el ends here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; emacs-30.init.el --- Iñaki Arenaza's Emacs main configuration file -*- lexical-binding: t -*- | |
| ;;; | |
| ;;; Commentary: | |
| ;;; | |
| ;;; Bits and pieces shamelessly stolen from various places. | |
| ;;; | |
| ;;; Code: | |
| ;;;; --- Disable arbitrary code evaluation ----------------------------- | |
| ;; From "Emacs code completion can cause compromise" | |
| ;; https://lwn.net/Articles/1002046/ | |
| (setq auto-mode-alist (rassq-delete-all 'emacs-lisp-mode auto-mode-alist)) | |
| (setq enable-local-variables nil) | |
| ;;;; --- Custom set variables and faces ---------------------------------------- | |
| ;; We store them in a separate file, so we don't pollute init.el | |
| ;; change history. Load them early enough so they are available as | |
| ;; soon as possible. | |
| (setq custom-file (expand-file-name (format "emacs-%s.custom.el" emacs-major-version) | |
| user-emacs-directory)) | |
| (when (file-exists-p custom-file) | |
| (load custom-file)) | |
| ;;;; --- straight.el ----------------------------------------------------------- | |
| ;; Ignore automatic package rebuilding entirely. In that case, | |
| ;; packages will only be rebuilt when metadata (e.g. the recipe or the | |
| ;; Emacs version) changes, or when you manually invoke M-x | |
| ;; straight-rebuild-package or M-x straight-rebuild-all. | |
| ;; Be sure to read | |
| ;; https://github.com/radian-software/straight.el/tree/develop#customizing-when-packages-are-built | |
| ;; for the consequences of this. | |
| ;; The default value for this is '(find-at-startup find-when-checking) | |
| (setopt straight-check-for-modifications nil) | |
| ;; By default straight.el's main directory, containing it's build | |
| ;; files and package repos, is located in the user-emacs-directory. We | |
| ;; want to use different directories per emacs version to avoid issues | |
| ;; with byte-compilation and native compilation (they are usually | |
| ;; version-specific) | |
| (setopt straight-base-dir (expand-file-name (format "straight-emacs-%s" emacs-major-version) | |
| user-emacs-directory)) | |
| ;; Tell straight.el about the profiles we are going to be using. We | |
| ;; are specially interested in providing a 'pinned profile, for the | |
| ;; packages that we want to use pinned to specific git commits. From | |
| ;; https://github.com/radian-software/straight.el#how-do-i-pin-package-versions-or-use-only-tagged-releases | |
| (setopt straight-profiles | |
| '((nil . "default.el") | |
| ;; Packages which are pinned to a specific commit. | |
| (pinned . "pinned.el"))) | |
| ;; Silence "reference to free variable" warnings | |
| (setopt bootstrap-version 7) | |
| (setopt straight-repository-branch "master") | |
| ;; Now bootstrap straight.el, if not already installed, or load it if | |
| ;; already installed. Copied from | |
| ;; https://github.com/radian-software/straight.el#getting-started | |
| (let ((bootstrap-file | |
| (expand-file-name "straight/repos/straight.el/bootstrap.el" | |
| (or (bound-and-true-p straight-base-dir) | |
| user-emacs-directory)))) | |
| (unless (file-exists-p bootstrap-file) | |
| (with-current-buffer | |
| (url-retrieve-synchronously | |
| (format "https://raw.githubusercontent.com/radian-software/straight.el/%s/install.el" | |
| (if (boundp 'straight-repository-branch) | |
| straight-repository-branch | |
| "develop")) | |
| 'silent 'inhibit-cookies) | |
| (goto-char (point-max)) | |
| (eval-print-last-sexp))) | |
| (load bootstrap-file nil 'nomessage)) | |
| ;; Autoload extension that allows us to pin packages to exect commit versions. | |
| ;; See https://github.com/radian-software/straight.el/tree/develop#how-do-i-pin-package-versions-or-use-only-tagged-releases | |
| (autoload 'straight-x-freeze-pinned-versions "straight-x") | |
| (autoload 'straight-x-freeze-versions "straight-x") | |
| ;; Tell the linter that these two variables are already defined, | |
| ;; probably as dynamic variables, in some of the already loaded | |
| ;; straight modules (so it doesn't complaint about them being free | |
| ;; variables). | |
| (defvar straight-x-pinned-packages) | |
| (defvar straight-current-profile) | |
| (defun iarenaza/set-pinned-package! (package version) | |
| "Set PACKAGE to VERSION in `straight-x-pinned-packages`. | |
| Takes care of updating PACKAGE to VERSION if it's already in the | |
| list of pinned packages/ Otherwise, it adds PACKAGE with the | |
| corresponding VERSION to the list of pinned packages." | |
| (let ((pinned-package (assoc-string package straight-x-pinned-packages))) | |
| (if pinned-package | |
| (progn | |
| (setcdr pinned-package version) | |
| straight-x-pinned-packages) | |
| (push (cons package version) straight-x-pinned-packages)))) | |
| ;;;; --- use-package ----------------------------------------------------------- | |
| ;; | |
| (autoload 'straight-use-package "straight") | |
| (if (< emacs-major-version 29) | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin use-package and bind-key version to release 2.4.1 | |
| (iarenaza/set-pinned-package! "use-package" "caa92f1d64fc25480551757d854b4b49981dfa6b") | |
| (iarenaza/set-pinned-package! "bind-key" "caa92f1d64fc25480551757d854b4b49981dfa6b") | |
| (straight-x-freeze-pinned-versions) | |
| ;; We install use-package via straight.el (so we can use a pinned | |
| ;; version). From here on, we can use use-package if we prefer it. | |
| (straight-use-package 'use-package) | |
| (straight-use-package 'bind-key)) | |
| (progn | |
| ;; Emacs 29 and later has use-package built-in. So no need to install | |
| ;; external versions. We load (activate) via straight.el. From | |
| ;; here on, we can use use-package if we prefer it. | |
| (straight-use-package '(use-package :type built-in)) | |
| (straight-use-package '(bind-key :type built-in)))) | |
| ;; --- Visual Theme ------------------------------------------------------------ | |
| ;; | |
| ;; Load theme early, before package installation. Several packages use | |
| ;; the theme faces to set their own colors and faces. | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin modus-themes to release 4.6.0 | |
| (push '("modus-themes" . "895e10936adac93aa8187c9cc91092dbca898677") | |
| straight-x-pinned-packages) | |
| (straight-x-freeze-pinned-versions) | |
| (use-package modus-themes | |
| :straight (modus-themes :type git | |
| :host gitlab | |
| :repo "protesilaos/modus-themes") | |
| :custom | |
| (modus-themes-italic-constructs 't) | |
| (modus-themes-bold-constructs 't) | |
| (modus-themes-to-toggle '(modus-operandi-deuteranopia | |
| modus-vivendi-deuteranopia)) | |
| :config | |
| (modus-themes-load-theme 'modus-vivendi-deuteranopia))) | |
| ;;;; --- clojure-mode ---------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin clojure-mode version to release 5.20.0 | |
| (iarenaza/set-pinned-package! "clojure-mode" "d336db623e7ae8cffff50aaaea3f1b05cc4ccecb") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package clojure-mode | |
| :straight t | |
| :custom | |
| ;; Eval top level forms inside comment forms instead of the comment form itself. | |
| (clojure-toplevel-inside-comment-form 't) | |
| :config | |
| ;; Indentation rules for Compojure Macros (they are a bit special) | |
| ;; From https://github.com/weavejester/cljfmt/blob/master/cljfmt/resources/cljfmt/indents/compojure.clj | |
| ;; using the syntax defined in https://github.com/clojure-emacs/clojure-mode#indentation-of-macro-forms | |
| (define-clojure-indent | |
| (ANY 2) | |
| (DELETE 2) | |
| (GET 2) | |
| (HEAD 2) | |
| (OPTIONS 0) | |
| (PATCH 2) | |
| (POST 2) | |
| (PUT 2) | |
| (context 2) | |
| (defroutes 0) | |
| (let-routes 1) | |
| (rfn 0)) | |
| :hook | |
| ;; Make sure we don't wrap lines in Clojure(Script) mode buffers | |
| ((clojure-mode . (lambda () (toggle-truncate-lines +1))) | |
| (clojurescript-mode . (lambda () (toggle-truncate-lines +1)))))) | |
| ;;;; --- aggressive-indent ----------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin aggressive-indent to commit a437a45868f94b77362c6b913c5ee8e67b273c42 | |
| (iarenaza/set-pinned-package! "aggressive-indent" "a437a45868f94b77362c6b913c5ee8e67b273c42") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package aggressive-indent | |
| :straight t | |
| :hook | |
| ((clojure-mode . aggressive-indent-mode) | |
| (clojurescript--mode . aggressive-indent-mode)))) | |
| ;;;; --- CIDER ----------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin cider to release 1.18.0 | |
| (iarenaza/set-pinned-package! "cider" "6d2d09318423f373bdbd546e97dc3e32b21c10e4") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package cider | |
| :straight t | |
| :custom | |
| (;; Customize REPL pritty printing. | |
| (cider-repl-use-pretty-printing t) | |
| ;; For this to work, I have to make sure I have the `fipp` | |
| ;; dependency injected into the projects. E.g., by adding it to | |
| ;; ~/sandbox/applications/.cider-support-files/profiles.clj | |
| (cider-print-fn 'fipp) | |
| (cider-print-quota 20480 "Set it to 20K (the default is 1M)") | |
| ;; Don't display the initial banner with the links to the manual, | |
| ;; some high-level CIDER commands, etc. | |
| (cider-repl-display-help-banner nil) | |
| ;; Don't try to to resolve java.net.URIs and print the body when | |
| ;; evaluating them at the REPL This can also be a security issue. | |
| (cider-repl-use-content-types nil) | |
| ;; Let CIDER know about some cider-connect endpoints | |
| (cider-known-endpoints '(("docker" "127.0.0.1" "4001") | |
| ("docker" "127.0.0.1" "4002") | |
| ("docker" "127.0.0.1" "4003") | |
| ("docker" "127.0.0.1" "4004") | |
| ("docker" "127.0.0.2" "4001") | |
| ("docker" "127.0.0.3" "4001")))) | |
| :config | |
| ;; Add the local variables set by Duct to the list of safe local | |
| ;; variables. | |
| (dolist (var | |
| '((cider-ns-refresh-after-fn . "integrant.repl/resume") | |
| (cider-ns-refresh-before-fn . "integrant.repl/suspend") | |
| (cider-refresh-after-fn . "integrant.repl/resume") | |
| (cider-refresh-before-fn . "integrant.repl/suspend"))) | |
| (push var safe-local-variable-values)) | |
| ;; Show tooltip with info for the symbol at point. From | |
| ;; https://github.com/dpsutton/tangled/blob/master/init.org#tooltip-for-doc-stuff | |
| (defun iarenaza/cider-tooltip-show () | |
| (interactive) | |
| (if-let ((info (cider-var-info (thing-at-point 'symbol)))) | |
| (nrepl-dbind-response info (doc arglists-str name ns) | |
| (message (format "%s : %s\n%s\n%s" ns (or name "") (or arglists-str "") (or doc "")) | |
| nil | |
| nil | |
| nil | |
| -1)) | |
| (message "info not found"))) | |
| ;; Use internal text-mode browser to browse Java doc, etc. | |
| (defun iarenaza/browse-javadoc-internally () | |
| (setq-local browse-url-browser-function 'eww-browse-url)) | |
| :hook | |
| ((cider-mode . eldoc-mode) | |
| (cider-repl-mode . subword-mode) | |
| (cider-mode . iarenaza/browse-javadoc-internally)) | |
| :bind | |
| (:map cider-mode-map ("C-c t" . iarenaza/cider-tooltip-show)))) | |
| ;;;; --- paredit --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin paredit to v26 commit 72cc1f6055321a53021186b86d2f825167b81478 | |
| (iarenaza/set-pinned-package! "paredit" "72cc1f6055321a53021186b86d2f825167b81478") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package paredit | |
| :straight t | |
| :bind | |
| ;; Paredit 25+ binds RET to `paredit-RET`. This can cause | |
| ;; unexpected behaviour in the REPL when paredit-mode is enabled, | |
| ;; e.g. it appears to hang after hitting RET instead of evaluating | |
| ;; the last form. Set that binding to `nil` to disable that | |
| ;; behaviour. | |
| (:map paredit-mode-map ("RET" . nil)) | |
| :hook | |
| ((clojure-mode . enable-paredit-mode) | |
| (clojurescript-mode . enable-paredit-mode) | |
| (emacs-lisp-mode . enable-paredit-mode) | |
| (cider-repl-mode . paredit-mode)))) | |
| ;;;; --- multiple-cursors ---------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin multiple-cursors to commit dd10cf2334333838e4550f091a75695448e26765 | |
| (iarenaza/set-pinned-package! "multiple-cursors" "dd10cf2334333838e4550f091a75695448e26765") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package multiple-cursors | |
| :straight t | |
| :bind | |
| ;; Bind Ctrl-Super-c (Super == Win key) to mc/edit-lines | |
| (("C-s-c" . mc/edit-lines)))) | |
| ;;;; --- company --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin company to commit 7805174a9ffae3194d5bbde16febcf26761f0ad7 | |
| (iarenaza/set-pinned-package! "company" "7805174a9ffae3194d5bbde16febcf26761f0ad7") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package company | |
| :straight t | |
| :custom | |
| ;; Lower the number of characters that triggers completion (the default is 3). | |
| (company-minimum-prefix-length 2) | |
| ;; Show numbers for the completion options. Press M-<number> to select it. | |
| (company-show-numbers t) | |
| ;; Selecting item before first or after last wraps around. | |
| (company-selection-wrap-around t) | |
| :custom-face | |
| (company-tooltip-selection ((t (:background "blue" :foreground "white")))) | |
| :config | |
| (global-company-mode) | |
| :hook | |
| ((cider-mode . company-mode) | |
| (cider-repl-mode . company-mode) | |
| (cider-mode . cider-enable-flex-completion) | |
| (cider-repl-mode . cider-enable-flex-completion)))) | |
| ;;;; --- rainbow-delimiters ---------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin rainbow-delimiters to commit f40ece58df8b2f0fb6c8576b527755a552a5e763 | |
| (iarenaza/set-pinned-package! "rainbow-delimiters" "f40ece58df8b2f0fb6c8576b527755a552a5e763") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package rainbow-delimiters | |
| :straight t | |
| ;; :custom-face | |
| ;; (rainbow-delimiters-depth-2-face ((t (:foreground "#d2691e")))) | |
| ;; (rainbow-delimiters-depth-3-face ((t (:foreground "#d02090")))) | |
| ;; (rainbow-delimiters-depth-4-face ((t (:foreground "#ffff00")))) | |
| :hook | |
| ((emacs-lisp-mode . rainbow-delimiters-mode) | |
| (clojure-mode . rainbow-delimiters-mode) | |
| (cider-repl-mode . rainbow-delimiters-mode)))) | |
| ;;;; --- which-key ------------------------------------------------------------- | |
| ;; | |
| ;; Emacs 30 has which-key built-in. So no need to install external | |
| ;; versions. We load (activate) via straight.el. From here on, we | |
| ;; can use use-package if we prefer it. | |
| (when (< emacs-major-version 30) | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin which-key to commit 38d4308d1143b61e4004b6e7a940686784e51500 | |
| (iarenaza/set-pinned-package! "which-key" "38d4308d1143b61e4004b6e7a940686784e51500") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package which-key | |
| ;; bindings following your currently entered | |
| ;; incomplete command (a prefix) in a popup. | |
| :straight t))) | |
| (which-key-mode) | |
| ;;;; --- magit ----------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin magit to release 4.1.3 | |
| (iarenaza/set-pinned-package! "magit" "7adad8c8d3bd61ae36659638751223cfa2c7d720") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package magit | |
| :straight t | |
| :custom | |
| ;; Set transient LEVEL to the maximum (expert mode, so to | |
| ;; speak). It's 4 by default, and it hides some advanced options | |
| ;; that I use from time to time. | |
| (transient-default-level 7) | |
| ;; Enable the --sign option of magit-tag by default. | |
| (transient-values '((magit-tag "--sign"))) | |
| :custom-face | |
| ;; (magit-section-highlight ((t (:background "#0000ee")))) | |
| (transient-value ((t (:foreground "#ffffff" :underline t :weight bold)))) | |
| :bind | |
| ("M-C-g" . magit-status))) | |
| (defun iarenaza/magit-stash-read-message () | |
| "Read a message from the minibuffer, to be used for a stash. | |
| The message that Git would have picked, is available as the | |
| default (used when the user enters the empty string) and as | |
| the next history element (which can be accessed with \ | |
| \\<minibuffer-local-map>\\[next-history-element]). | |
| Copied and adapted from the original magit-stash-read-message() | |
| function." | |
| (read-string "Stash message (default: On ...:...): " | |
| (format "On %s: %s - " (or (magit-get-current-branch) "(no branch)") | |
| (format-time-string "%Y.%m.%d %H:%M")))) | |
| (setopt magit-stash-read-message-function #'iarenaza/magit-stash-read-message) | |
| ;;;; --- flycheck -------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin flycheck to release 34.1 | |
| (iarenaza/set-pinned-package! "flycheck" "5a9ff918f91e230ae08a6bdce7ec1f107864a5e2") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package flycheck | |
| :straight t | |
| :custom | |
| (flycheck-python-pylint-executable "pylint3") | |
| :hook | |
| ((after-init . global-flycheck-mode)))) | |
| ;;;; --- flycheck-clj-kondo ---------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin flycheck-clj-kondo to commit e38c67ba9db1ea1cbe1b61ab39b506c05efdcdbf | |
| (iarenaza/set-pinned-package! "flycheck-clj-kondo" "e38c67ba9db1ea1cbe1b61ab39b506c05efdcdbf") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package flycheck-clj-kondo | |
| :straight t)) | |
| ;;;; --- web-mode -------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin web-mode to version 17.3.20 | |
| (iarenaza/set-pinned-package! "web-mode" "0c83581d1e93d1d802c730a1d5e90cd1c740e1b2") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package web-mode | |
| :straight t)) | |
| ;;;; --- yaml-mode ------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin yaml-mode to commit d91f878729312a6beed77e6637c60497c5786efa | |
| (iarenaza/set-pinned-package! "yaml-mode" "d91f878729312a6beed77e6637c60497c5786efa") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package yaml-mode | |
| :straight t | |
| :mode (("\\.yml'" . yaml-mode) | |
| ("\\.yaml'" . yaml-mode)))) | |
| ;;;; --- markdown-mode --------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin markdown-mode to commit 8692afc12e13431efb0c302baee1de5bbf4a41e4 | |
| (iarenaza/set-pinned-package! "markdown-mode" "8692afc12e13431efb0c302baee1de5bbf4a41e4") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package markdown-mode | |
| :straight t | |
| :commands (markdown-mode gfm-mode) | |
| :mode (("README\\.md\\'" . gfm-mode) | |
| ("\\.md\\'" . markdown-mode) | |
| ("\\.markdown\\'" . markdown-mode)) | |
| :custom | |
| ;; Set the command to produce HTML output from Markdown. | |
| (markdown-command "~/bin/gfm --readme"))) | |
| ;;;; --- restclient ------------------------------------------------------------ | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin restclient to commit 85ba4dba675a395bb74983ff9acb7060bd1a2333 | |
| (iarenaza/set-pinned-package! "restclient" "85ba4dba675a395bb74983ff9acb7060bd1a2333") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package restclient | |
| :straight (:package restclient | |
| :type git | |
| :host nil | |
| :repo "file:///home/biotz/sandbox/tools/restclient.el"))) | |
| ;;;; --- ripgrep --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin ripgrep to commit b6bd5beb0c11348f1afd9486cbb451d0d2e3c45a | |
| (iarenaza/set-pinned-package! "ripgrep" "b6bd5beb0c11348f1afd9486cbb451d0d2e3c45a") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package ripgrep | |
| :straight t | |
| :custom | |
| ;; Look into hidden directorys and files too (but respect 'ignore' files) | |
| ;; and do case insensitive search | |
| (ripgrep-arguments '("--hidden" "--ignore-case")))) | |
| ;;;; --- wgrep --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin wgrep to commit 49f09ab9b706d2312cab1199e1eeb1bcd3f27f6f | |
| (iarenaza/set-pinned-package! "wgrep" "49f09ab9b706d2312cab1199e1eeb1bcd3f27f6f") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package wgrep | |
| :straight t)) | |
| ;;;; --- projectile ------------------------------------------------------------ | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin projectile to commit d18e308ea9b7473b69f904d40ed4835b3e34d5e2 | |
| (iarenaza/set-pinned-package! "projectile" "d18e308ea9b7473b69f904d40ed4835b3e34d5e2") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package projectile | |
| :straight t | |
| :init | |
| (projectile-mode +1) | |
| :custom | |
| ;; Debian installs 'fd' tools with the 'fdfind' executable name. | |
| ;; Thus we need to customize the projectile-generic-command to | |
| ;; use that name, instead of the default 'fd' name. | |
| (projectile-generic-command "fdfind . -0 --type f --color=never") | |
| ;; Once a project is selected, open the top-level directory of the project | |
| ;; in a dired buffer (instead of having to visit a particular file) | |
| (projectile-switch-project-action #'projectile-dired) | |
| ;; https://github.com/bbatsov/projectile/pull/1762 broke the | |
| ;; globally ignored directory list when using ripgrep to find | |
| ;; strings/regexps. Until they find a way to fix it (without | |
| ;; breaking other search tools like find, ag, etc), we'll keep our | |
| ;; own "un-broken" list :-) | |
| (projectile-globally-ignored-directories '(".idea" | |
| ".vscode" | |
| ".ensime_cache" | |
| ".eunit" | |
| ".git" | |
| ".hg" | |
| ".fslckout" | |
| "_FOSSIL_" | |
| ".bzr" | |
| "_darcs" | |
| ".pijul" | |
| ".tox" | |
| ".svn" | |
| ".stack-work" | |
| ".ccls-cache" | |
| ".cache" | |
| ".clangd")) | |
| :bind | |
| (:map projectile-mode-map ("C-c p" . projectile-command-map)))) | |
| ;;;; --- lsp-mode -------------------------------------------------------------- | |
| ;; | |
| (defvar iarenaza/lsp-clojure-modes | |
| '(clojure-mode | |
| clojurescript-mode | |
| clojurec-mode)) | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin lsp-mode to commit 8e0363457455dc3cdfa3f6c818f044c78b66d4fc | |
| (iarenaza/set-pinned-package! "lsp-mode" "8e0363457455dc3cdfa3f6c818f044c78b66d4fc") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package lsp-mode | |
| :straight t | |
| :custom | |
| (lsp-client-packages '(lsp-clojure)) | |
| (gc-cons-threshold (* 100 1024 1024)) | |
| (read-process-output-max (* 1024 1024)) | |
| ;; I already have flycheck-clj-kondo in place, so disable | |
| ;; diagnostics via lsp-mode (we are doing the same work twice) | |
| (lsp-diagnostics-provider :none) | |
| ;; I found the breadcrumb too distracting, so disabled it | |
| (lsp-headerline-breadcrumb-enable nil) | |
| ;; Don't want lenses, it clutters the display when using Emacs in | |
| ;; terminal mode. | |
| (lsp-lens-enable nil) | |
| ;; Don't auto activate signatures ever. I don't want to see them. | |
| (lsp-signature-auto-activate nil) | |
| ;; Don't try using yasnippet from lsp-mode, I don't install it. | |
| (lsp-enable-snippet nil) | |
| ;; Set to `nil` to use Cider for indentation instead, of lsp-mode. | |
| (lsp-enable-indentation nil) | |
| ;; Set to `t` to use lsp-mode completion instead of Cider. Works | |
| ;; without a REPL connection too. | |
| (lsp-completion-enable t) | |
| ;; Set to `nil` to disable lsp-mode showing eldoc during symbol at | |
| ;; point. It conflicts with CIDER same feature, they both fight to | |
| ;; show the signature and the end result is that no signature is | |
| ;; shown! | |
| (lsp-eldoc-enable-hover nil) | |
| ;; :hook | |
| ;; ((clojure-mode . lsp) | |
| ;; (clojurescript-mode . lsp) | |
| ;; (clojurec-mode . lsp)) | |
| )) | |
| ;;;; --- vertico --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin vertico to release 1.10 | |
| (iarenaza/set-pinned-package! "vertico" "6ef99c9219b55b7618d111d352caf795ba07bc54") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package vertico | |
| :straight (vertico :type git | |
| :host github | |
| :repo "minad/vertico") | |
| :config | |
| (vertico-mode +1) | |
| :custom | |
| ;; Enable cycling for `vertico-next' and `vertico-previous'. | |
| (vertico-cycle t))) | |
| ;;;; --- savehist-mode --------------------------------------------------------- | |
| ;; | |
| (use-package savehist | |
| ;; Persist history over Emacs restarts. Vertico sorts by history position. | |
| :straight (:type built-in) | |
| :config | |
| (savehist-mode)) | |
| ;;;; --- marginalia --------------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin marginalia to release 1.8 | |
| (iarenaza/set-pinned-package! "marginalia" "006a7cd0a14dd651dcff65ed96c0d52d2067b8c1") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package marginalia | |
| :straight (marginalia :type git | |
| :host github | |
| :repo "minad/marginalia") | |
| :config | |
| (marginalia-mode +1))) | |
| ;;;; --- easysession.el ----------------------------------------------------------- | |
| ;; | |
| (let ((straight-current-profile 'pinned)) | |
| ;; Pin easysession to release 1.1.1 | |
| (iarenaza/set-pinned-package! "easysession" "f45896a6d29966c7a9f63f0a4c603245c1609877") | |
| (straight-x-freeze-pinned-versions) | |
| (use-package easysession | |
| :straight t | |
| :config | |
| (defun iarenaza/setup-easysession () | |
| ;; Disable LSP mode hooks before loading the session, to avoid | |
| ;; running the lsp server on startup for each Clojure(Script) | |
| ;; buffer stored in the session. And re-enable the hooks after | |
| ;; loading the session. | |
| (dolist (mode iarenaza/lsp-clojure-modes) | |
| (let ((mode-hook (intern (concat (symbol-name mode) "-hook")))) | |
| (remove-hook mode-hook #'lsp))) | |
| (easysession-load-including-geometry) | |
| (easysession-save-mode) | |
| (dolist (mode iarenaza/lsp-clojure-modes) | |
| (let ((mode-hook (intern (concat (symbol-name mode) "-hook")))) | |
| (add-hook mode-hook #'lsp))) | |
| (remove-hook 'server-after-make-frame-hook #'iarenaza/setup-easysession)) | |
| ;; This one is for when we use emacs server + emacsclient. We want | |
| ;; to run this only once we have a frame | |
| (add-hook 'server-after-make-frame-hook #'iarenaza/setup-easysession) | |
| ;; This one is for when we use the regular emacs (no server involved). | |
| (add-hook 'emacs-startup-hook #'iarenaza/setup-easysession) | |
| :custom | |
| ;; Interval between automatic session saves (in seconds). | |
| (easysession-save-interval (* 10 60)))) | |
| ;;;; --- Miscellanous settings ------------------------------------------------- | |
| ;; | |
| ;; ... | |
| ;; tons of extra personal settings go here | |
| ;; .... | |
| ;;; emacs-30.init.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment