switch from straight to package.el

This commit is contained in:
William Ball 2025-08-13 22:24:57 -07:00
parent 53acc291e1
commit 6a7c88bc3c
No known key found for this signature in database

View file

@ -30,34 +30,15 @@
auto-save-default t)
#+end_src
* Packages
** Straight.el
#+begin_src emacs-lisp
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7))
(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))
#+end_src
** use-package
#+begin_src emacs-lisp
(straight-use-package 'use-package)
(use-package straight
:custom (straight-use-package-by-default t))
(require 'use-package)
(setq use-package-always-ensure t)
(setq use-package-verbose t)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
#+end_src
** Set up path correctly
#+begin_src emacs-lisp
@ -106,7 +87,7 @@
(t
:default-family "Iosevka Nerd Font"
:default-weight normal
:variable-pitch-family "Adwaita Sans")))
:variable-pitch-family "Inter")))
(fontaine-set-preset 'regular))
#+end_src
** Which key
@ -168,13 +149,6 @@
(use-package ace-window
:bind (("M-o" . ace-window)))
#+end_src
*** Avy
#+begin_src emacs-lisp
(use-package avy
:bind (("C-o" . avy-goto-char))
:custom
(avy-keys . (?a ?r ?s ?t ?d ?h ?n ?e ?i ?o)))
#+end_src
* Completion
** Vertico
#+begin_src emacs-lisp
@ -184,8 +158,7 @@
#+end_src
** Savehist
#+begin_src emacs-lisp
(use-package savehist
:straight (:type built-in)
(use-package emacs
:init (savehist-mode))
#+end_src
** Orderless
@ -297,6 +270,36 @@
(setq consult-narrow-key "<"))
#+end_src
* Lsp
** eglot
#+begin_src emacs-lisp
(use-package eglot
:bind (:map eglot-mode-map
("C-c l r" . eglot-rename)
("C-c l f" . eglot-format-buffer)
("C-c l a" . eglot-code-actions)
("C-c l q" . eglot-code-action-quickfix)
("C-c l d" . xref-find-definitions)
("C-c l i" . eglot-find-implementation)
("C-c l t" . eglot-find-type-definition)
("C-c l s" . xref-find-references)
("C-c l h" . eldoc)
("C-c l R" . eglot-restart-process)
("C-c l e" . eglot-errors-at-point))
(:map flymake-mode-map
("M-n" . flymake-goto-next-error)
("M-p" . flymake-goto-prev-error)))
#+end_src
** eldoc-box
#+begin_src emacs-lisp
(use-package eldoc-box
:hook (eglot-managed-mode . eldoc-box-hover-at-point-mode))
#+end_src
** Markdown
I don't really use markdown ([[Org Mode]] is a strict improvement imo), but it's handy for rendering documentation.
#+begin_src emacs-lisp
(use-package markdown-mode)
#+end_src
* Languages
** Agda
#+begin_src emacs-lisp
@ -325,46 +328,21 @@
(use-package haskell-mode)
#+end_src
** OCaml
#+begin_src emacs-lisp
(use-package tuareg
:mode (("\\.ocamlinit\\'" . tuareg-mode)))
#+end_src
** Rust
#+begin_src emacs-lisp
(use-package rust-mode
:hook
(rust-mode-hook . eglot-ensure))
(use-package eglot
:straight (:type built-in)
:bind (:map eglot-mode-map
("C-c l r" . eglot-rename)
("C-c l f" . eglot-format-buffer)
("C-c l a" . eglot-code-actions)
("C-c l q" . eglot-code-action-quickfix)
("C-c l d" . xref-find-definitions)
("C-c l i" . eglot-find-implementation)
("C-c l t" . eglot-find-type-definition)
("C-c l s" . xref-find-references)
("C-c l h" . eldoc)
("C-c l R" . eglot-restart-process)
("C-c l e" . eglot-errors-at-point))
(:map flymake-mode-map
("M-n" . flymake-goto-next-error)
("M-p" . flymake-goto-prev-error)))
#+end_src
** KDL
(For niri)
** Zig
#+begin_src emacs-lisp
(use-package kdl-mode)
(use-package zig-mode)
#+end_src
* Latex
** Auctex
#+begin_src emacs-lisp
(use-package tex-site
:straight auctex
(use-package tex
:ensure auctex
:hook
(LaTeX-mode . visual-line-mode)
(LaTeX-mode . flyspell-mode)
@ -453,34 +431,9 @@
#+end_src
* Org Mode
** Org itself
I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/][here]] in order to have much better LaTeX previews. This is eventually supposed to be merged into emacs proper, which would be nice.
#+begin_src emacs-lisp
(use-package org
:defer
:straight `(org
:fork (:host nil
:repo "https://git.tecosaur.net/tec/org-mode.git"
:branch "dev"
:remote "tecosaur")
:files (:defaults "etc")
:build t
:pre-build
(with-temp-file "org-version.el"
(require 'lisp-mnt)
(let ((version
(with-temp-buffer
(insert-file-contents "lisp/org.el")
(lm-header "version")))
(git-version
(string-trim
(with-temp-buffer
(call-process "git" nil t nil "rev-parse" "--short" "HEAD")
(buffer-string)))))
(insert
(format "(defun org-release () \"The release version of Org.\" %S)\n" version)
(format "(defun org-git-version () \"The truncate git commit hash of Org mode.\" %S)\n" git-version)
"(provide 'org-version)\n")))
:pin nil)
:init
(setq org-list-allow-alphabetical t)
:custom
@ -489,7 +442,6 @@ I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/
(org-startup-with-inline-images t)
(org-image-actual-width '(300))
(org-export-with-smart-quotes t)
(org-latex-preview-live t)
(org-directory "~/Nextcloud/org")
(org-cite-global-bibliography '("~/Nextcloud/library.bib"))
(org-agenda-files `(,org-directory))
@ -503,9 +455,9 @@ I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
:hook (org-mode . visual-line-mode)
(org-mode . flyspell-mode)
(org-mode . org-latex-preview-auto-mode))
:hook
(org-mode . visual-line-mode)
(org-mode . flyspell-mode))
#+end_src
** toki pona support
#+begin_src emacs-lisp
@ -559,7 +511,6 @@ I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/
("org-static"
:base-directory "~/repos/blog/static/"
:publishing-directory "/ssh:wball@ballcloud.cc:~/blog/static/"
:publishing-directory "~/repos/blog/public_html/static/"
:base-extension "ico\\|ttf\\|css"
:publishing-function org-publish-attachment
:recursive t
@ -571,7 +522,7 @@ I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/
:publishing-function org-publish-attachment
:recursive t
)
("org" :components ("org-posts" "org-static" "org-media"))
("org" :components ("org-posts" "org-static" "org-media" "org-pages"))
))
(use-package htmlize)
@ -606,22 +557,21 @@ I'm using the fork as described [[https://abode.karthinks.com/org-latex-preview/
(with-eval-after-load 'esh-opt
(setq eshell-destroy-buffer-when-process-dies t)))
(defalias 'ff 'find-file)
(defalias 'fo 'find-file-other-window)
(defalias 'clear 'clear-scrollback)
(defalias 'eshell/ff 'find-file)
(defalias 'eshell/fo 'find-file-other-window)
#+end_src
** eat
#+begin_src emacs-lisp
(use-package eat)
#+end_src
** Dired
#+begin_src emacs-lisp
(use-package dired
:straight (:type built-in)
(use-package emacs
:commands (dired dired-jump)
:custom ((dired-listing-switches "-agho --group-directories-first"))
:config
(require 'dired-x))
(use-package dired-single
:after dired)
(use-package dired-hide-dotfiles
:hook (dired-mode . dired-hide-dotfiles-mode))
#+end_src