summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-12-11 11:18:14 +0000
committerYann Herklotz <git@yannherklotz.com>2022-12-11 11:18:14 +0000
commitae6bba1e299079f177cc59b841ec8f6de8ef7266 (patch)
tree3abb688b752c327aea617ef716a6ffcbf3d5429a
parent7003c1669a079fd1e2a8f2b258648e7fe460b9f8 (diff)
downloadymh-emacs-ae6bba1e299079f177cc59b841ec8f6de8ef7266.tar.gz
ymh-emacs-ae6bba1e299079f177cc59b841ec8f6de8ef7266.zip
Use use-package with package.el
-rw-r--r--init.el180
1 files changed, 89 insertions, 91 deletions
diff --git a/init.el b/init.el
index 1690e1e..e2d21a3 100644
--- a/init.el
+++ b/init.el
@@ -34,28 +34,14 @@
(set-register ?p (cons 'file "~/Dropbox/org/projects.org"))
(set-register ?c (cons 'file (format-time-string "~/Dropbox/org/%Y-%m.org")))
-(defvar bootstrap-version)
-(let ((bootstrap-file
- (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
- (bootstrap-version 6))
- (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))
-(setq straight-use-package-by-default t)
-
-(straight-use-package 'use-package)
+(require 'package)
+(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
+(package-initialize)
(use-package ymh-common
- :straight nil
:load-path "ymh-emacs")
(use-package emacs
- :straight nil
:init
(setq gnus-init-file (expand-file-name "gnus.el" user-emacs-directory))
@@ -145,17 +131,14 @@
(add-hook 'ns-system-appearance-change-functions #'ymhg/apply-theme))))
(use-package ymh-diary
- :straight nil
:load-path "ymh-emacs")
(use-package shr
- :straight nil
:init
(setq shr-use-fonts nil)
(setq shr-max-image-proportion 0.5))
(use-package browse-url
- :straight nil
:init
(setq browse-url-handlers
'(("wikipedia\\.org" . eww-browse-url)
@@ -171,7 +154,6 @@
("pragmaticemacs\\.com" . eww-browse-url))))
(use-package message
- :straight nil
:init
(setq message-send-mail-function 'message-send-mail-with-sendmail)
(setq message-fill-column 80)
@@ -181,17 +163,16 @@ Imperial College London
https://yannherklotz.com"))
(use-package ispell
- :straight nil
:init
(setq ispell-dictionary "british"))
(use-package delight
+ :ensure t
:config
(delight 'auto-revert-mode nil "autorevert")
(delight 'eldoc-mode nil "eldoc"))
(use-package project
- :straight nil
:init
(setq project-switch-commands
'((project-find-file "Find file")
@@ -204,7 +185,6 @@ https://yannherklotz.com"))
(define-key project-prefix-map "m" #'magit-project-status))
(use-package tab-bar
- :straight nil
:init
(setq tab-bar-show nil)
(setq tab-bar-select-tab-modifiers '(meta))
@@ -218,13 +198,11 @@ https://yannherklotz.com"))
(setq flyspell-mouse-map (make-sparse-keymap)))
(use-package calc-forms
- :straight nil
:config
(add-to-list 'math-tzone-names '("AOE" 12 0))
(add-to-list 'math-tzone-names '("IST" (float -55 -1) 0)))
(use-package calendar
- :straight nil
:config
(setq calendar-mark-diary-entries-flag t)
(setq calendar-mark-holidays-flag t)
@@ -253,13 +231,11 @@ https://yannherklotz.com"))
(define-key map (kbd "M-p") #'calendar-backward-month)))
(use-package cal-dst
- :straight nil
:config
(setq calendar-standard-time-zone-name "+0000")
(setq calendar-daylight-time-zone-name "+0100"))
(use-package diary-lib
- :straight nil
:config
(setq diary-file "~/Dropbox/org/diary")
(setq diary-date-forms diary-iso-date-forms)
@@ -279,7 +255,6 @@ https://yannherklotz.com"))
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files))
(use-package appt
- :straight nil
:init
(setq appt-display-diary nil)
(setq appt-disp-window-function #'appt-disp-window)
@@ -292,27 +267,30 @@ https://yannherklotz.com"))
(run-at-time 10 nil #'appt-activate 1))
(use-package savehist
- :straight nil
:init
(savehist-mode))
(use-package ef-themes
+ :ensure t
:config
(load-theme 'ef-dark t))
(use-package modus-themes
+ :ensure t
:config
;;(load-theme 'modus-vivendi t)
)
(use-package pass
+ :ensure t
:bind (:map ymh-map
("q" . password-store-otp-token-copy)
("p" . password-store-copy)
("i" . password-store-insert)
("g" . password-store-generate)))
-(use-package magit)
+(use-package magit
+ :ensure t)
(use-package org
:init
@@ -397,7 +375,6 @@ https://yannherklotz.com"))
(unbind-key "C-," org-mode-map))
(use-package org-agenda
- :straight nil
:bind ("C-c a" . org-agenda)
:init
(setq org-agenda-files (mapcar 'expand-file-name
@@ -424,7 +401,6 @@ https://yannherklotz.com"))
(setq org-agenda-show-all-dates t))
(use-package org-capture
- :straight nil
:bind ("C-c c" . org-capture)
:init
(setq org-capture-templates
@@ -453,10 +429,9 @@ https://yannherklotz.com"))
:END:" :empty-lines 1))))
(use-package org-habit
- :straight nil)
+ :after org)
(use-package org-crypt
- :straight nil
:after org
:config
(org-crypt-use-before-save-magic)
@@ -464,79 +439,86 @@ https://yannherklotz.com"))
(setq org-crypt-key "8CEF4104683551E8"))
(use-package org-id
- :straight nil
:after org
:config
(setq org-id-link-to-org-use-id 'use-existing)
(setq org-id-track-globally t))
(use-package org-transclusion
+ :ensure t
:after org
:config
(setq org-transclusion-exclude-elements nil))
-(use-package org-zettelkasten
- :after org
- :init
- (setq org-zettelkasten-directory "~/Dropbox/zk")
- :config
- (defun org-zettelkasten-abs-file (file) (expand-file-name file org-zettelkasten-directory))
-
- (defun org-zettelkasten-goto-id (id)
- "Go to an ID."
- (interactive "sID: #")
- (let (abs-link org-zettelkasten-abs-file)
- (cond ((string-prefix-p "1" id)
- (org-link-open-from-string
- (concat "[[file:" (abs-link "hls.org") "::#" id "]]")))
- ((string-prefix-p "2" id)
- (org-link-open-from-string
- (concat "[[file:" (abs-link "computing.org") "::#" id "]]")))
- ((string-prefix-p "3" id)
- (org-link-open-from-string
- (concat "[[file:" (abs-link "verification.org") "::#" id "]]")))
- ((string-prefix-p "4" id)
- (org-link-open-from-string
- (concat "[[file:" (abs-link "mathematics.org") "::#" id "]]")))
- ((string-prefix-p "5" id)
- (org-link-open-from-string
- (concat "[[file:" (abs-link "hardware.org") "::#" id "]]"))))))
- (define-key ymh-map (kbd "C-g") #'org-zettelkasten-goto-id)
-
- (define-key ymh-map (kbd "s")
- (lambda () (interactive)
- (let ((org-agenda-files
- (mapcar #'org-zettelkasten-abs-file
- '("hls.org"
- "computing.org"
- "verification.org"
- "mathematics.org"
- "hardware.org")))) (org-search-view))))
- (add-hook 'org-mode-hook #'org-zettelkasten-mode))
+;;(use-package org-zettelkasten
+;; :after org
+;; :init
+;; (setq org-zettelkasten-directory "~/Dropbox/zk")
+;; :config
+;; (defun org-zettelkasten-abs-file (file) (expand-file-name file org-zettelkasten-directory))
+;;
+;; (defun org-zettelkasten-goto-id (id)
+;; "Go to an ID."
+;; (interactive "sID: #")
+;; (let (abs-link org-zettelkasten-abs-file)
+;; (cond ((string-prefix-p "1" id)
+;; (org-link-open-from-string
+;; (concat "[[file:" (abs-link "hls.org") "::#" id "]]")))
+;; ((string-prefix-p "2" id)
+;; (org-link-open-from-string
+;; (concat "[[file:" (abs-link "computing.org") "::#" id "]]")))
+;; ((string-prefix-p "3" id)
+;; (org-link-open-from-string
+;; (concat "[[file:" (abs-link "verification.org") "::#" id "]]")))
+;; ((string-prefix-p "4" id)
+;; (org-link-open-from-string
+;; (concat "[[file:" (abs-link "mathematics.org") "::#" id "]]")))
+;; ((string-prefix-p "5" id)
+;; (org-link-open-from-string
+;; (concat "[[file:" (abs-link "hardware.org") "::#" id "]]"))))))
+;; (define-key ymh-map (kbd "C-g") #'org-zettelkasten-goto-id)
+;;
+;; (define-key ymh-map (kbd "s")
+;; (lambda () (interactive)
+;; (let ((org-agenda-files
+;; (mapcar #'org-zettelkasten-abs-file
+;; '("hls.org"
+;; "computing.org"
+;; "verification.org"
+;; "mathematics.org"
+;; "hardware.org")))) (org-search-view))))
+;; (add-hook 'org-mode-hook #'org-zettelkasten-mode))
(use-package pdf-tools
+ :ensure t
:config
(pdf-tools-install))
(use-package flycheck
+ :ensure t
:delight flycheck-mode)
-(use-package rst)
+(use-package rst
+ :ensure t)
(use-package boogie-friends
+ :ensure t
:config
(setq flycheck-dafny-executable (executable-find "dafny"))
(setq dafny-verification-backend 'cli))
(use-package direnv
+ :ensure t
:config
(direnv-mode))
(use-package orderless
+ :ensure t
:init
(setq completion-styles '(substring orderless basic)))
(use-package vertico
+ :ensure t
:init
(setq read-file-name-completion-ignore-case t)
(setq read-buffer-completion-ignore-case t)
@@ -545,10 +527,12 @@ https://yannherklotz.com"))
(vertico-mode))
(use-package corfu
+ :ensure t
:init
(global-corfu-mode))
(use-package consult
+ :ensure t
:bind (("M-s r" . consult-ripgrep)
("M-s g" . consult-git-grep)
("C-h a" . consult-apropos)
@@ -556,7 +540,6 @@ https://yannherklotz.com"))
("M-s h" . consult-org-heading)))
(use-package dabbrev
- :straight nil
;; Swap M-/ and C-M-/
:bind (("M-/" . dabbrev-completion)
("C-M-/" . dabbrev-expand))
@@ -565,6 +548,7 @@ https://yannherklotz.com"))
(dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'")))
(use-package sendmail
+ :ensure t
:init
(setq mail-specify-envelope-from t)
(setq message-sendmail-envelope-from 'header)
@@ -575,6 +559,7 @@ https://yannherklotz.com"))
(setq sendmail-program "/usr/bin/msmtp")))
(use-package notmuch
+ :ensure t
:config
(defun ymhg/notmuch-search-delete-mail (&optional beg end)
"Delete a message."
@@ -630,9 +615,11 @@ https://yannherklotz.com"))
(setq +notmuch-home-function (lambda () (notmuch-search "tag:inbox"))))
-(use-package ol-notmuch)
+(use-package ol-notmuch
+ :ensure t)
(use-package ebib
+ :ensure t
:bind (("C-c y b" . ebib)
("C-c [" . ebib-insert-citation))
:init
@@ -662,12 +649,12 @@ https://yannherklotz.com"))
(remove-hook 'ebib-notes-new-note-hook #'org-narrow-to-subtree))
(use-package ymh-ebib
- :straight nil
:load-path "ymh-emacs"
:config
(define-key ebib-index-mode-map "D" #'ymh-ebib-download-pdf-from-doi))
(use-package spell-fu
+ :ensure t
:hook text-mode
:config
(add-hook 'spell-fu-mode-hook
@@ -682,28 +669,33 @@ https://yannherklotz.com"))
(spell-fu-dictionary-add
(spell-fu-get-personal-dictionary "fr-personal" "~/.aspell.fr_FR.pws")))))
-(use-package ledger-mode)
+(use-package ledger-mode
+ :ensure t)
(use-package geiser
+ :ensure t
:config
;;(unbind-key "C-." geiser-mode-map)
;;(unbind-key "C-." geiser-repl-mode-map)
)
(use-package geiser-chicken
+ :ensure t
:config
(setq geiser-chicken-binary "chicken-csi"))
-(use-package bufferlo
- :straight (:host github :repo "florommel/bufferlo")
- :defer nil
- :bind (("C-x b" . bufferlo-switch-to-buffer))
- :config
- (bufferlo-mode 1))
+;;(use-package bufferlo
+;; :ensure (:host github :repo "florommel/bufferlo")
+;; :defer nil
+;; :bind (("C-x b" . bufferlo-switch-to-buffer))
+;; :config
+;; (bufferlo-mode 1))
-(use-package haskell-mode)
+(use-package haskell-mode
+ :ensure t)
(use-package proof-general
+ :ensure t
:config
(setq proof-splash-enable nil)
(setq proof-auto-action-when-deactivating-scripting 'retract)
@@ -728,6 +720,7 @@ https://yannherklotz.com"))
)
(use-package alectryon
+ :ensure t
:hook (coq-mode . alectryon-mode)
:delight alectryon-mode
:config
@@ -745,7 +738,7 @@ https://yannherklotz.com"))
(define-key alectryon-mode-map (kbd "C-c u p") #'ymhg/alectryon-preview))
(use-package tex
- :straight auctex
+ :ensure auctex
:init
(setq TeX-auto-save t)
(setq TeX-parse-self t)
@@ -761,16 +754,21 @@ https://yannherklotz.com"))
#'TeX-revert-document-buffer)
(add-hook 'TeX-mode-hook #'reftex-mode)
(add-hook 'TeX-mode-hook #'outline-minor-mode)
+ (add-hook 'LaTeX-mode-hook
+ (lambda () (setq reftex-ref-style-default-list '("Default" "Cleveref"))))
(with-eval-after-load 'latex
(define-key LaTeX-mode-map
" "
#'ymhg/electric-space)))
-(use-package ox-hugo)
-(use-package ox-gfm)
+(use-package ox-hugo
+ :ensure t)
+
+(use-package ox-gfm
+ :ensure t)
(use-package smartparens-config
- :straight smartparens
+ :ensure smartparens
:defer nil
:config
(smartparens-global-mode)
@@ -822,7 +820,6 @@ https://yannherklotz.com"))
(sp-local-pair "=" "=" :wrap "C-=")))
(use-package verilog-mode
- :straight nil
:defer t
:no-require t
:config
@@ -830,6 +827,7 @@ https://yannherklotz.com"))
(add-to-list 'auto-mode-alist '("\\.sv\\'" . verilog-mode)))
(use-package hungry-delete
+ :ensure t
:config
(global-hungry-delete-mode))