Switch EVERYTHING to Elpaca and away from straight. Will break all configs

This commit is contained in:
MitchMarq42 2022-12-09 10:40:49 -09:00
parent 274d01a0e3
commit e278d849ee
2 changed files with 183 additions and 133 deletions

View File

@ -61,10 +61,10 @@
;; straight.el: the better package manager?
;; minified bootstrap (split lines if you want) (or not)
(defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (setq straight-use-package-by-default t)
;; (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (setq straight-use-package-by-default t)
;; actually, use elpaca instead
;; (require 'elpaca-bootstrap) (elpaca use-package (require 'use-package))
(require 'elpaca-bootstrap) (elpaca use-package (require 'use-package))
;; actually, don't because it's broken on Windows

View File

@ -7,34 +7,40 @@
;;; Code:
;; diminish
(use-package diminish)
(use-package eldoc
:straight (:type built-in)
(elpaca-use-package diminish)
(elpaca-use-package eldoc
;; :straight (:type built-in)
:ensure nil
:diminish
:defer 1
:custom (eldoc-echo-area-use-multiline-p nil))
;; save minibuffer history, see Vertico below
(use-package savehist
:straight (:type built-in)
(elpaca-use-package savehist
;; :straight (:type built-in)
:ensure nil
:init (savehist-mode)
:custom (savehist-file
(expand-file-name "minibuffer-history" backup-directory)))
;; save place in all files
(use-package saveplace
:straight (:type built-in)
(elpaca-use-package saveplace
;; :straight (:type built-in)
:ensure nil
:init (save-place-mode t)
:custom
(save-place-file
(expand-file-name "file-position-save" backup-directory)))
(use-package tramp
:straight (:type built-in)
(elpaca-use-package tramp
;; :straight (:type built-in)
:ensure nil
:after eshell
:custom (tramp-persistency-file-name
(expand-file-name "tramp-history" backup-directory)))
;; Visualize whitespace. In a very chill and invisible way.
(use-package whitespace
:straight (:type built-in)
(elpaca-use-package whitespace
;; :straight (:type built-in)
:ensure nil
:diminish (whitespace-mode org-indent-mode org-vw-mode auto-fill-mode)
:custom
(whitespace-style '(face lines-tail))
@ -43,27 +49,29 @@
:hook
(prog-mode . whitespace-mode)
(org-mode . auto-fill-mode))
(use-package image-mode
:straight (:type built-in)
(elpaca-use-package image-mode
;; :straight (:type built-in)
:ensure nil
:config
(turn-off-line-numbers)
(blink-cursor-mode -1))
;; ...and finally, sync files with disk changes
(use-package autorevert
:straight (:type built-in)
(elpaca-use-package autorevert
;; :straight (:type built-in)
:ensure nil
:diminish auto-revert-mode
:config (global-auto-revert-mode))
;; Keybinding manager
(use-package general
:straight t
(elpaca-use-package general
;; :straight t
:config (mitch/general-config))
(use-package use-package-ensure-system-package)
;; (elpaca-use-package use-package-ensure-system-package)
;; load evil
(use-package evil
(elpaca-use-package evil
:general
;; Visual lines. Redefined for auto-scrolling madness.
(general-define-key
@ -93,27 +101,27 @@
(quote undo-fu)))
:init (evil-mode t)
:config (mitch/evil-config))
(use-package evil-collection
:straight t
(elpaca-use-package evil-collection
;; :straight t
:after evil
:diminish evil-collection-unimpaired-mode
:config (evil-collection-init))
(use-package evil-commentary
:straight t
(elpaca-use-package evil-commentary
;; :straight t
:diminish 'evil-commentary-mode
:config (evil-commentary-mode)
:hook (prog-mode . evil-commentary-mode))
(use-package evil-surround
:straight t
(elpaca-use-package evil-surround
;; :straight t
:diminish 'global-evil-surround-mode
:hook (prog-mode . evil-surround-mode)
:config (global-evil-surround-mode 1))
(use-package evil-matchit
:straight t
(elpaca-use-package evil-matchit
;; :straight t
:diminish 'evil-matchit-mode
:config (global-evil-matchit-mode 1))
(use-package evil-terminal-cursor-changer
:straight t
(elpaca-use-package evil-terminal-cursor-changer
;; :straight t
:after evil
:diminish
:if (not (display-graphic-p))
@ -126,19 +134,20 @@
:config
(evil-terminal-cursor-changer-activate)
(xterm-mouse-mode))
(use-package undo-fu
(elpaca-use-package undo-fu
:after evil
:if (< (string-to-number emacs-version) 28)
:diminish)
(use-package altcaps
:straight (:type git :host github :repo "protesilaos/altcaps")
(elpaca-use-package (altcaps :host github :repo "protesilaos/altcaps")
;; :straight (:type git :host github :repo "protesilaos/altcaps")
:general (general-define-key
:states 'visual
"`" 'altcaps-region))
;; eshell. Pretty good actually.
(use-package eshell
:straight (:type built-in)
(elpaca-use-package eshell
;; :straight (:type built-in)
:ensure nil
:commands (eshell/emacs eshell/man)
:custom
(eshell-scroll-to-bottom-on-input t)
@ -168,20 +177,22 @@ This is taken from a website that I can't remember at the moment."
(advice-add 'evil-collection-eshell-setup-keys
:after 'mitch/eshell-setup-keys))
(use-package eat
:straight (:repo "https://codeberg.org/akib/emacs-eat"
:files ("*.el" "dir" "*.info" "*.texi" "*.ti" ("e" "e/*")))
(elpaca-use-package (eat :repo "https://codeberg.org/akib/emacs-eat")
;; :straight (:repo "https://codeberg.org/akib/emacs-eat"
;; :files ("*.el" "dir" "*.info" "*.texi" "*.ti" ("e" "e/*")))
:hook (eshell-mode . eat-eshell-visual-command-mode))
;; (use-package eshell-vterm
;; (elpaca-use-package eshell-vterm
;; :after eshell
;; :custom (eshell-destroy-buffer-when-process-dies t)
;; :hook (eshell-mode . eshell-vterm-mode))
(use-package eshell-syntax-highlighting
(elpaca-use-package eshell-syntax-highlighting
:after eshell
:hook (eshell-mode . eshell-syntax-highlighting-mode))
(use-package eshell-dat
:straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/eshell-dat"))
(use-package eshell-prompt-extras
(elpaca-use-package (eshell-dat :repo "https://git.mitchmarq42.xyz/mitch/eshell-dat")
:after eshell
;; :straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/eshell-dat")
)
(elpaca-use-package eshell-prompt-extras
:after eshell
:custom
(eshell-highlight-prompt nil)
@ -189,9 +200,9 @@ This is taken from a website that I can't remember at the moment."
(epe-path-style 'full))
;; File manager. Only breaks when you brag about how it doesn't.
(use-package all-the-icons)
(use-package dirvish
:straight (:files (:defaults "extensions/*.el"))
(elpaca-use-package all-the-icons)
(elpaca-use-package (dirvish :files (:defaults "extensions/*.el"))
;; :straight (:files (:defaults "extensions/*.el"))
:defer 0.5
:commands dirvish
:custom
@ -218,8 +229,8 @@ This is taken from a website that I can't remember at the moment."
"t" 'dirvish-side))
;; Completion framework...
(use-package vertico
:straight (:files (:defaults "extensions/vertico-mouse.el"))
(elpaca-use-package (vertico :files (:defaults "extensions/vertico-mouse.el"))
;; :straight (:files (:defaults "extensions/vertico-mouse.el"))
:custom (vertico-resize t)
:init (vertico-mode t)
:config
@ -240,21 +251,23 @@ see https://www.reddit.com/r/emacs/comments/xq6rpa/comment/iqynyu9/?utm_source=
(general-define-key
:prefix-map 'minibuffer-mode-map
"DEL" 'backspace-in-minibuffer))
(use-package vertico-mouse
:straight vertico
:after vertico
:config
(vertico-mouse-mode))
(use-package consult
(elpaca nil
(use-package vertico-mouse
:ensure nil
;; :straight vertico
:after vertico
:config
(vertico-mouse-mode)))
(elpaca-use-package consult
:after vertico
:general
(general-define-key
[remap switch-to-buffer] 'consult-buffer))
;; Minibuffer generic stuff
(use-package marginalia
(elpaca-use-package marginalia
;; :custom (marginalia-separator " ")
:init (marginalia-mode))
(use-package orderless
(elpaca-use-package orderless
:custom
(completion-styles '(orderless partial-completion basic))
(completion-category-defaults nil)
@ -262,7 +275,7 @@ see https://www.reddit.com/r/emacs/comments/xq6rpa/comment/iqynyu9/?utm_source=
(completion-category-overrides nil))
;; weird multi-path thing
(use-package embark
(elpaca-use-package embark
:general
(general-define-key
:keymap minibuffer-mode-map
@ -302,11 +315,11 @@ targets."
:around #'embark-hide-which-key-indicator)
:custom (enable-recursive-minibuffers t))
;; Consult users will also want the embark-consult package.
(use-package embark-consult
(elpaca-use-package embark-consult
:after (embark consult))
;; SORTA WORKING: Relative line numbers with stuff
(use-package nlinum-relative
(elpaca-use-package nlinum-relative
:custom
(nlinum-relative-redisplay-delay 0)
:hook (prog-mode . nlinum-relative-mode)
@ -339,7 +352,7 @@ targets."
(add-hook 'minibuffer-exit-hook #'mitch/nlinum-buffer-setup))
;; broken terminal that doesn't compile but at least it's fast when it does
(use-package vterm
(elpaca-use-package vterm
:custom
(vterm-always-compile-module t)
(vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
@ -375,7 +388,7 @@ targets."
:hook
(vterm-mode . mitch/terminal-setup)
(vterm-exit-functions . save-buffers-kill-terminal))
(use-package multi-vterm
(elpaca-use-package multi-vterm
:commands (multi-vterm multi-vterm-other-window)
:config
(defun multi-vterm-other-window ()
@ -395,13 +408,13 @@ targets."
"v" 'multi-vterm-other-window))
;; Better modeline? Better modeline.
(use-package powerline
(elpaca-use-package powerline
:custom
(powerline-display-buffer-size nil)
(powerline-default-separator 'utf-8)
(powerline-utf-8-separator-left (string-to-char ""))
(powerline-utf-8-separator-right (string-to-char "")))
(use-package airline-themes
(elpaca-use-package airline-themes
:custom
(airline-cursor-colors nil)
(airline-display-directory t)
@ -413,14 +426,15 @@ targets."
;; Custom Theme.
;; Not to be confused with a color theme, or a color scheme, or a custom scheme.
(use-package mitch-theme
:straight (:type git :repo
"https://git.mitchmarq42.xyz/mitch/vimcolors"
:files (:defaults "mitch-theme.el"))
(elpaca-use-package (mitch-theme :repo
"https://git.mitchmarq42.xyz/mitch/vimcolors")
;; :straight (:type git :repo
;; "https://git.mitchmarq42.xyz/mitch/vimcolors"
;; :files (:defaults "mitch-theme.el"))
:config (mitch/visual-setup)
:init (load-theme 'mitch t))
(use-package yascroll
(elpaca-use-package yascroll
:diminish
:defer 1
;; :if (not (display-graphic-p))
@ -448,7 +462,9 @@ targets."
(global-yascroll-bar-mode 1))
;; parentheses settingses
(use-package paredit
(elpaca-use-package paredit
;; elpaca declaration is broken, I just cloned it manually to .config/emacs/elpaca/repos
;; see my issue https://github.com/progfolio/elpaca/issues/40
:diminish
:general (general-define-key
"M-j" 'paredit-forward-slurp-sexp
@ -463,13 +479,14 @@ targets."
:custom
(show-paren-delay 0)
(show-paren-style 'parenthesis))
(use-package evil-paredit
(elpaca-use-package evil-paredit
:after paredit
:hook (evil-mode . evil-paredit-mode))
;; org mode and messy things
(use-package org
:straight (:type built-in)
(elpaca-use-package org
;; :straight (:type built-in)
:ensure nil
:diminish (org-indent-mode org-vw-mode)
:custom
(org-hide-leading-stars t)
@ -504,8 +521,6 @@ See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode
:states 'insert
:keymaps 'org-mode-map
"`" (general-key-dispatch 'self-insert-command
(use-package org-tempo
:straight (:type built-in)
:timeout 0.1
"SPC" 'insert-zws))
(general-define-key
@ -518,15 +533,14 @@ See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode
"~" 'mitch/org-dwim-char
"=" 'mitch/org-dwim-char))
(elpaca-use-package org-tempo
;; :straight (:type built-in)
:ensure nil
:after org
:config
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("el" . "src elisp"))
(add-to-list 'org-structure-template-alist '("html" . "src html")))
(use-package org-pretty-table
:straight (:type git
:host github
:repo "Fuco1/org-pretty-table")
;; (elpaca-use-package org-variable-pitch
;; :after org
;; :if (display-graphic-p)
@ -544,9 +558,13 @@ See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode
;; (org-appear-autoentities t)
;; (org-appear-autokeywords t)
;; (org-appear-autosubmarkers t))
(elpaca-use-package (org-pretty-table :host github :repo "Fuco1/org-pretty-table")
;; :straight (:type git
;; :host github
;; :repo "Fuco1/org-pretty-table")
:diminish
:hook (org-mode . org-pretty-table-mode))
(use-package ox-hugo
(elpaca-use-package ox-hugo
:after org
:config
(defun hugo-dir-above (dir)
@ -577,35 +595,35 @@ Return nil if DIR is not in a hugo project at all."
;; :hook (org-mode . adaptive-wrap-prefix-mode))
;; cheaty key popups
(use-package which-key
(elpaca-use-package which-key
:diminish
:defer 5
:custom (which-key-idle-delay 2.5)
:init (which-key-mode t))
;; parentheses are boring
(use-package rainbow-delimiters
(elpaca-use-package rainbow-delimiters
:diminish
:defer 1
:hook (prog-mode . rainbow-delimiters-mode))
;; Hex colors
(use-package rainbow-mode
(elpaca-use-package rainbow-mode
:diminish
:hook (prog-mode . rainbow-mode))
;; Nobody loves a good language
(use-package powershell
(elpaca-use-package powershell
:mode ("\\.ps1\\'" . powershell-mode))
;; or an okay language
(use-package cider
(elpaca-use-package cider
:defer 1)
;; c sharp; taken from https://www.reddit.com/r/emacs/comments/k8tnzg/help_setting_up_c_lsp_omnisharproslyn/
;; (there is nothing here because I'm not using c sharp...)
(use-package lsp-mode
(elpaca-use-package lsp-mode
:hook ((powershell-mode . lsp-mode)
(lsp-mode . lsp-enable-which-key-integration)
(lsp-completion-mode . corfu/lsp-mode-setup-completion))
@ -617,13 +635,14 @@ Return nil if DIR is not in a hugo project at all."
'(flex))))
;; broken snippets I don't care about...
(use-package yasnippet
(elpaca-use-package yasnippet
:diminish yas-minor-mode
:hook (prog-mode . yas-minor-mode))
(use-package yasnippet-snippets)
(elpaca-use-package yasnippet-snippets
:after '(org sh-script))
;; Better help-pages. Genuinely pretty great.
(use-package helpful
(elpaca-use-package helpful
:general (general-define-key
[remap describe-key] 'helpful-key
[remap describe-variable] 'helpful-variable
@ -639,12 +658,12 @@ Return nil if DIR is not in a hugo project at all."
:custom (elisp-refs-verbose nil))
;; Better lisp highlighting?
(use-package highlight-defined
(elpaca-use-package highlight-defined
:hook (emacs-lisp-mode . highlight-defined-mode))
(use-package relint)
(elpaca-use-package relint)
;; Shell linting?
(use-package flymake
(elpaca-use-package flymake
:diminish
:custom
(flymake-note-bitmap '(right-arrow compilation-info))
@ -653,11 +672,11 @@ Return nil if DIR is not in a hugo project at all."
:hook (prog-mode . flymake-mode))
;; Emacs startup profiling -- may not work with chemacs2
(use-package esup
(elpaca-use-package esup
:commands esup)
;; Blingy laggy minimap on the right
(use-package minimap
(elpaca-use-package minimap
:general (general-define-key
:states 'normal
:prefix-command 'mini-map-prefix
@ -675,13 +694,14 @@ Return nil if DIR is not in a hugo project at all."
((nil (:background "#afafaf" :extend t)))))
;; epic drop-down completion
;; (use-package company
;; (elpaca-use-package company
;; :diminish
;; :custom ;(company-require-match nil)
;; (company-tooltip-align-annotations t)
;; :hook (prog-mode . company-mode))
(use-package corfu
(elpaca-use-package (corfu :files (:defaults "extensions/*.el"))
:if (display-graphic-p)
;; :straight (:files (:defaults "extensions/*.el"))
:custom
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
(corfu-auto t) ;; Enable auto completion
@ -707,24 +727,46 @@ Return nil if DIR is not in a hugo project at all."
[tab] 'corfu-next
[backtab] 'corfu-previous
"RET" 'corfu-insert
(use-package popon
:straight
(:type git
:repo "https://codeberg.org/akib/emacs-popon")
"ESC" 'corfu-quit
"C-h" 'corfu-info-documentation
"C-f" 'corfu-info-location))
(elpaca nil
(use-package corfu-echo
:ensure nil
:custom (corfu-echo-delay t)
:after corfu
:config (corfu-echo-mode)))
(elpaca nil
(use-package corfu-history
:ensure nil
:after corfu
:config (corfu-history-mode)))
(elpaca-use-package cape
:after corfu
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-ispell))
(elpaca-use-package pcmpl-args
:after eshell)
(elpaca-use-package (popon :type git
:repo "https://codeberg.org/akib/emacs-popon")
;; :straight
;; (:type git
;; :repo "https://codeberg.org/akib/emacs-popon")
:if (not (display-graphic-p)))
(use-package corfu-terminal
:straight
(:type git
:repo "https://codeberg.org/akib/emacs-corfu-terminal")
(elpaca-use-package (corfu-terminal :type git
:repo "https://codeberg.org/akib/emacs-corfu-terminal")
;; :straight
;; (:type git
;; :repo "https://codeberg.org/akib/emacs-corfu-terminal")
:after popon
:init (unless
(display-graphic-p)
(corfu-terminal-mode +1)))
(use-package magit
(elpaca-use-package magit
:commands (madots magit-status magit)
:hook (magit-mode . turn-off-line-numbers)
:config
@ -750,41 +792,45 @@ Return nil if DIR is not in a hugo project at all."
(magit-status)
(run-with-timer 5 3 #'madots--cleanup)))
(use-package hyperbole
(elpaca-use-package hyperbole
:diminish
:general (general-define-key
:states 'normal
"RET" 'hkey-either))
(use-package dconf-mode
:straight
(:type git
:repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el"))
(elpaca-use-package (dconf-mode :type git :repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el")
;; :straight
;; (:type git
;; :repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el")
)
(use-package info-variable-pitch
:straight
(:type git :host github
(elpaca-use-package (info-variable-pitch :host github
:repo "kisaragi-hiu/info-variable-pitch")
;; :straight
;; (:type git :host github
;; :repo "kisaragi-hiu/info-variable-pitch")
:config
(add-hook 'Info-mode-hook #'info-variable-pitch-mode))
;; (use-package exwm
;; (elpaca-use-package exwm
;; ;; :init
;; ;; (require 'exwm-config)
;; ;; (exwm-config-example))
(use-package ani-el
:straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/ani-el"
:files ("ani-el.el" "lib")))
(elpaca-use-package (ani-el :repo "https://git.mitchmarq42.xyz/mitch/ani-el")
;; :straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/ani-el"
;; :files ("ani-el.el" "lib"))
)
(use-package slime
(elpaca-use-package slime
:if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el"))
:custom (inferior-lisp-program "sbcl")
:init (load (expand-file-name "~/quicklisp/slime-helper.el")))
;; built in spell checker, for losers
(use-package flyspell
:straight (:type built-in)
(elpaca-use-package flyspell
;; :straight (:type built-in)
:ensure nil
:diminish
:custom
(flyspell-auto-correct-word t)
@ -792,21 +838,25 @@ Return nil if DIR is not in a hugo project at all."
(org-mode . flyspell-mode))
;; Java never looked so useful...
(use-package clojure-mode)
(use-package inf-clojure)
(elpaca-use-package clojure-mode
:mode "\\.cljs\\'")
(elpaca-use-package inf-clojure
:after clojure-mode)
;; unique buffer names
(use-package uniquify
:straight (:type built-in)
(elpaca-use-package uniquify
;; :straight (:type built-in)
:ensure nil
:custom (uniquify-buffer-name-style 'forward))
;; cache file cleanup
(use-package kkc
:straight (:type built-in)
(elpaca-use-package kkc
;; :straight (:type built-in)
:ensure nil
:custom (kkc-init-file-name (expand-file-name "kkcrc" backup-directory)))
;; see https://www.reddit.com/r/emacs/comments/xyo2fo/orgmode_vterm_tmux/
(use-package ob-tmux
(elpaca-use-package ob-tmux
:after (org dash)
:config
(setq org-src-lang-modes (-replace
@ -822,19 +872,19 @@ Return nil if DIR is not in a hugo project at all."
(org-babel-tmux-terminal "/home/mitch/.local/bin/emacs-term-shim.sh")
(org-babel-tmux-terminal-opts))
(use-package dwim-shell-command
:straight (:files (:defaults "dwim-shell-commands.el"))
(elpaca-use-package (dwim-shell-command :files (:defaults "dwim-shell-commands.el"))
;; :straight (:files (:defaults "dwim-shell-commands.el"))
:config (require 'dwim-shell-commands)
:commands dwim-shell-commands-kill-process)
(use-package youtube-sub-extractor
:straight (:type git :host github :repo "agzam/youtube-sub-extractor.el")
(elpaca-use-package (youtube-sub-extractor :host github :repo "agzam/youtube-sub-extractor.el")
;; :straight (:type git :host github :repo "agzam/youtube-sub-extractor.el")
:custom (youtube-sub-extractor-timestamps 'left-margin)
:commands youtube-sub-extractor-extract-subs)
;; Cheat sheet
(use-package cheat-sh
:straight (:type git :host github :repo "davep/cheat-sh.el")
(elpaca-use-package (cheat-sh :host github :repo "davep/cheat-sh.el")
;; :straight (:type git :host github :repo "davep/cheat-sh.el")
:commands cheat-sh)
(provide 'mitch-packages)