straight.el -> elpaca
This commit is contained in:
parent
e5f4051ed1
commit
f4fe800c75
|
@ -19,11 +19,11 @@
|
||||||
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
|
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
|
||||||
(add-to-list 'load-path (expand-file-name "contrib" user-emacs-directory))
|
(add-to-list 'load-path (expand-file-name "contrib" user-emacs-directory))
|
||||||
|
|
||||||
(add-hook 'emacs-startup-hook
|
(defun display-startup-echo-area-message ()
|
||||||
(lambda ()
|
"Custom version of `display-startup-echo-area-message'."
|
||||||
(message "%s packages loaded in %0.1f seconds"
|
(message "%s packages loaded in %0.1f seconds"
|
||||||
(hash-table-count straight--profile-cache)
|
(cdar elpaca--status-counts)
|
||||||
(string-to-number (emacs-init-time)))))
|
(string-to-number (emacs-init-time))))
|
||||||
|
|
||||||
(add-hook 'after-init-hook #'(lambda ()
|
(add-hook 'after-init-hook #'(lambda ()
|
||||||
(setq gc-cons-threshold (* 100 1024 1024)
|
(setq gc-cons-threshold (* 100 1024 1024)
|
||||||
|
@ -37,34 +37,34 @@
|
||||||
(load (prin1-to-string feature) noerror nil nil t)
|
(load (prin1-to-string feature) noerror nil nil t)
|
||||||
(require feature filename noerror)))
|
(require feature filename noerror)))
|
||||||
|
|
||||||
(require! 'init-packages)
|
(require 'init-packages)
|
||||||
(require! 'init-ui)
|
(require 'init-ui)
|
||||||
(require! 'init-compile)
|
(require 'init-compile)
|
||||||
(require! 'init-editor)
|
(require 'init-editor)
|
||||||
(require! 'init-search)
|
(require 'init-search)
|
||||||
(require! 'init-windows)
|
(require 'init-windows)
|
||||||
(require! 'init-project)
|
(require 'init-project)
|
||||||
(require! 'init-modeline)
|
(require 'init-modeline)
|
||||||
(require! 'init-completion)
|
(require 'init-completion)
|
||||||
(require! 'init-minibuffer)
|
(require 'init-minibuffer)
|
||||||
(require! 'init-navigation)
|
(require 'init-navigation)
|
||||||
(require! 'init-kill)
|
(require 'init-kill)
|
||||||
(require! 'init-dired)
|
(require 'init-dired)
|
||||||
(require! 'init-smartparens)
|
(require 'init-smartparens)
|
||||||
(require! 'init-emacs-lisp)
|
(require 'init-emacs-lisp)
|
||||||
(require! 'init-clojure)
|
(require 'init-clojure)
|
||||||
(require! 'init-crux)
|
(require 'init-crux)
|
||||||
(require! 'init-lsp)
|
(require 'init-lsp)
|
||||||
(require! 'init-git)
|
(require 'init-git)
|
||||||
(require! 'init-shell)
|
(require 'init-shell)
|
||||||
(require! 'init-nix)
|
(require 'init-nix)
|
||||||
(require! 'init-org)
|
(require 'init-org)
|
||||||
;;(require! 'init-latex)
|
;;(require 'init-latex)
|
||||||
(require! 'init-xml)
|
(require 'init-xml)
|
||||||
(require! 'init-web)
|
(require 'init-web)
|
||||||
(require! 'init-misc)
|
(require 'init-misc)
|
||||||
(require! 'init-tramp)
|
(require 'init-tramp)
|
||||||
(require! 'init-sql)
|
(require 'init-sql)
|
||||||
(require! 'init-local nil t)
|
(require 'init-local nil t)
|
||||||
|
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
;; Based on code from prelude-editor.el
|
;; Based on code from prelude-editor.el
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package compile
|
(use-feature compile
|
||||||
:custom
|
:custom
|
||||||
(compilation-ask-about-save nil)
|
(compilation-ask-about-save nil)
|
||||||
(compilation-always-kill t)
|
(compilation-always-kill t)
|
||||||
(compilation-scroll-output 'first-error))
|
(compilation-scroll-output 'first-error))
|
||||||
|
|
||||||
;; http://stackoverflow.com/a/3072831/355252
|
;; http://stackoverflow.com/a/3072831/355252
|
||||||
(use-package ansi-color
|
(use-feature ansi-color
|
||||||
:hook
|
:hook
|
||||||
(compilation-filter . (lambda ()
|
(compilation-filter . (lambda ()
|
||||||
(when (eq major-mode 'compilation-mode)
|
(when (eq major-mode 'compilation-mode)
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
(advice-add #'fancy-dabbrev--on-exit :after #'fancy-dabbrev-popup-exit-advice)
|
(advice-add #'fancy-dabbrev--on-exit :after #'fancy-dabbrev-popup-exit-advice)
|
||||||
:bind ("M-/" . fancy-dabbrev-expand))
|
:bind ("M-/" . fancy-dabbrev-expand))
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:init
|
:init
|
||||||
(setq completion-cycle-threshold 3)
|
(setq completion-cycle-threshold 3)
|
||||||
(setq tab-always-indent 'complete))
|
(setq tab-always-indent 'complete))
|
||||||
|
@ -130,8 +130,8 @@ no words in between, beginning with the first word."
|
||||||
|
|
||||||
;; code completion - corfu
|
;; code completion - corfu
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
:straight (corfu :files (:defaults "extensions/*")
|
:elpaca (corfu :files (:defaults "extensions/*")
|
||||||
:includes (corfu-indexed corfu-quick corfu-history corfu-info corfu-popupinfo))
|
:includes (corfu-indexed corfu-quick corfu-history corfu-info corfu-popupinfo))
|
||||||
:custom
|
:custom
|
||||||
(corfu-cycle t)
|
(corfu-cycle t)
|
||||||
:bind (:map corfu-map
|
:bind (:map corfu-map
|
||||||
|
@ -139,7 +139,7 @@ no words in between, beginning with the first word."
|
||||||
([tab] . corfu-next)
|
([tab] . corfu-next)
|
||||||
("S-TAB" . corfu-previous)
|
("S-TAB" . corfu-previous)
|
||||||
([backtab] . corfu-previous))
|
([backtab] . corfu-previous))
|
||||||
:hook (emacs-startup . global-corfu-mode))
|
:hook (elpaca-after-init . global-corfu-mode))
|
||||||
|
|
||||||
(use-extension corfu corfu-indexed
|
(use-extension corfu corfu-indexed
|
||||||
:config (corfu-indexed-mode 1))
|
:config (corfu-indexed-mode 1))
|
||||||
|
@ -150,6 +150,7 @@ no words in between, beginning with the first word."
|
||||||
("M-'" . corfu-quick-exit)))
|
("M-'" . corfu-quick-exit)))
|
||||||
|
|
||||||
(use-extension corfu corfu-history
|
(use-extension corfu corfu-history
|
||||||
|
:after savehist
|
||||||
:config
|
:config
|
||||||
(corfu-history-mode 1)
|
(corfu-history-mode 1)
|
||||||
(add-to-list 'savehist-additional-variables 'corfu-history))
|
(add-to-list 'savehist-additional-variables 'corfu-history))
|
||||||
|
|
|
@ -3,21 +3,21 @@
|
||||||
;; based on prelude-editor.el
|
;; based on prelude-editor.el
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:bind
|
:bind
|
||||||
("C-x \\" . align-regexp)
|
("C-x \\" . align-regexp)
|
||||||
("C-+" . text-scale-increase)
|
("C-+" . text-scale-increase)
|
||||||
("C--" . text-scale-decrease)
|
("C--" . text-scale-decrease)
|
||||||
:hook
|
:hook
|
||||||
(after-save . executable-make-buffer-file-executable-if-script-p)
|
(after-save . executable-make-buffer-file-executable-if-script-p)
|
||||||
(emacs-startup . (lambda ()
|
(elpaca-after-init . (lambda ()
|
||||||
(save-place-mode 1)
|
(save-place-mode 1)
|
||||||
(delete-selection-mode t)
|
(delete-selection-mode t)
|
||||||
(global-auto-revert-mode 1)
|
(global-auto-revert-mode 1)
|
||||||
(set-terminal-coding-system 'utf-8)
|
(set-terminal-coding-system 'utf-8)
|
||||||
(set-keyboard-coding-system 'utf-8)
|
(set-keyboard-coding-system 'utf-8)
|
||||||
(set-selection-coding-system 'utf-8)
|
(set-selection-coding-system 'utf-8)
|
||||||
(prefer-coding-system 'utf-8)))
|
(prefer-coding-system 'utf-8)))
|
||||||
;; (text-mode . whitespace-cleanup)
|
;; (text-mode . whitespace-cleanup)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
@ -67,12 +67,12 @@
|
||||||
("M-z" . zop-up-to-char)
|
("M-z" . zop-up-to-char)
|
||||||
("M-Z" . zop-to-char))
|
("M-Z" . zop-to-char))
|
||||||
|
|
||||||
(use-package savehist
|
(use-feature savehist
|
||||||
:custom
|
:custom
|
||||||
(savehist-additional-variables '(search-ring regexp-search-ring))
|
(savehist-additional-variables '(search-ring regexp-search-ring))
|
||||||
(savehist-autosave-interval 60)
|
(savehist-autosave-interval 60)
|
||||||
(savehist-file (expand-file-name "savehist" save-dir))
|
(savehist-file (expand-file-name "savehist" save-dir))
|
||||||
:hook (after-init . savehist-mode))
|
:hook (elpaca-after-init . savehist-mode))
|
||||||
|
|
||||||
(use-package super-save
|
(use-package super-save
|
||||||
:defer 5
|
:defer 5
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
(add-to-list 'super-save-triggers 'ace-window)
|
(add-to-list 'super-save-triggers 'ace-window)
|
||||||
(add-to-list 'super-save-hook-triggers 'find-file-hook))
|
(add-to-list 'super-save-hook-triggers 'find-file-hook))
|
||||||
|
|
||||||
(use-package recentf
|
(use-feature recentf
|
||||||
:config
|
:config
|
||||||
(add-to-list 'recentf-exclude (expand-file-name "elpa" user-emacs-directory))
|
(add-to-list 'recentf-exclude (expand-file-name "elpa" user-emacs-directory))
|
||||||
(add-to-list 'recentf-exclude (expand-file-name "straight" user-emacs-directory))
|
(add-to-list 'recentf-exclude (expand-file-name "straight" user-emacs-directory))
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
(recentf-max-saved-items 300)
|
(recentf-max-saved-items 300)
|
||||||
(recentf-max-menu-items 20)
|
(recentf-max-menu-items 20)
|
||||||
(recentf-auto-cleanup (* 60 60))
|
(recentf-auto-cleanup (* 60 60))
|
||||||
:hook (after-init . recentf-mode))
|
:hook (elpaca-after-init . recentf-mode))
|
||||||
|
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:config
|
:config
|
||||||
|
@ -107,12 +107,12 @@
|
||||||
; (text-mode . (lambda () (flyspell-mode +1)))
|
; (text-mode . (lambda () (flyspell-mode +1)))
|
||||||
; (prog-mode . (lambda () (flyspell-prog-mode))))
|
; (prog-mode . (lambda () (flyspell-prog-mode))))
|
||||||
|
|
||||||
(use-package bookmark
|
(use-feature bookmark
|
||||||
:custom
|
:custom
|
||||||
(bookmark-default-file (expand-file-name "bookmarks" save-dir))
|
(bookmark-default-file (expand-file-name "bookmarks" save-dir))
|
||||||
(bookmark-save-flag 1))
|
(bookmark-save-flag 1))
|
||||||
|
|
||||||
(use-package midnight)
|
(use-feature midnight)
|
||||||
|
|
||||||
(use-package undo-tree
|
(use-package undo-tree
|
||||||
:defer 5
|
:defer 5
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
(prog-mode . abbrev-mode)
|
(prog-mode . abbrev-mode)
|
||||||
(cider-repl-mode . abbrev-mode))
|
(cider-repl-mode . abbrev-mode))
|
||||||
|
|
||||||
(use-package subword
|
(use-feature subword
|
||||||
:diminish)
|
:diminish)
|
||||||
|
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
(use-package editorconfig
|
(use-package editorconfig
|
||||||
:diminish
|
:diminish
|
||||||
:custom (editorconfig-trim-whitespaces-mode 'ws-butler-mode)
|
:custom (editorconfig-trim-whitespaces-mode 'ws-butler-mode)
|
||||||
:hook (emacs-startup . editorconfig-mode))
|
:hook (elpaca-after-init . editorconfig-mode))
|
||||||
|
|
||||||
(use-package titlecase
|
(use-package titlecase
|
||||||
;; TODO find a better binding
|
;; TODO find a better binding
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
(use-package elisp-slime-nav
|
(use-package elisp-slime-nav
|
||||||
:diminish)
|
:diminish)
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:config
|
:config
|
||||||
(defun eval-region-or-defun (edebug-it)
|
(defun eval-region-or-defun (edebug-it)
|
||||||
"Call eval-region, if one is selected, or eval-defun otherwise."
|
"Call eval-region, if one is selected, or eval-defun otherwise."
|
||||||
|
@ -48,16 +48,12 @@ Start `ielm' if it's not already running."
|
||||||
:hook
|
:hook
|
||||||
(ielm-mode . (lambda ()
|
(ielm-mode . (lambda ()
|
||||||
(eldoc-mode +1)
|
(eldoc-mode +1)
|
||||||
(rainbow-delimiters-mode +1)
|
|
||||||
(ielm-init-history)
|
(ielm-init-history)
|
||||||
(advice-add 'ielm-send-input :after 'ielm-write-history)))
|
(advice-add 'ielm-send-input :after 'ielm-write-history)))
|
||||||
(emacs-lisp-mode . (lambda ()
|
(emacs-lisp-mode . (lambda ()
|
||||||
(eldoc-mode +1)
|
(eldoc-mode +1)
|
||||||
(rainbow-mode +1)
|
|
||||||
(rainbow-delimiters-mode +1)
|
|
||||||
(setq mode-name "EL")
|
(setq mode-name "EL")
|
||||||
(recompile-init-lisp-on-save)
|
(recompile-init-lisp-on-save)))
|
||||||
(define-key emacs-lisp-mode-map "\C-c\C-v" erefactor-map)))
|
|
||||||
:bind
|
:bind
|
||||||
(:map emacs-lisp-mode-map
|
(:map emacs-lisp-mode-map
|
||||||
(("C-c C-z" . visit-ielm)
|
(("C-c C-z" . visit-ielm)
|
||||||
|
@ -75,7 +71,8 @@ Start `ielm' if it's not already running."
|
||||||
:hook
|
:hook
|
||||||
(emacs-lisp-mode . eros-mode))
|
(emacs-lisp-mode . eros-mode))
|
||||||
|
|
||||||
(use-package erefactor)
|
(use-package erefactor
|
||||||
|
:hook (emacs-lisp-mode . (lambda () (define-key emacs-lisp-mode-map "\C-c\C-v" erefactor-map))))
|
||||||
|
|
||||||
(use-package flycheck-package
|
(use-package flycheck-package
|
||||||
:hook
|
:hook
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package ediff
|
(use-feature ediff
|
||||||
:custom
|
:custom
|
||||||
(ediff-setup-windows-plain 'ediff-setup-windows-plain))
|
(ediff-setup-windows-plain 'ediff-setup-windows-plain))
|
||||||
|
|
||||||
(use-package diff-hl
|
(use-package diff-hl
|
||||||
:hook
|
:hook
|
||||||
(emacs-startup . global-diff-hl-mode)
|
(elpaca-after-init . global-diff-hl-mode)
|
||||||
(dired-mode . diff-hl-dired-mode)
|
(dired-mode . diff-hl-dired-mode)
|
||||||
(magit-post-refresh . diff-hl-magit-post-refresh))
|
(magit-post-refresh . diff-hl-magit-post-refresh))
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
:bind
|
:bind
|
||||||
("C-x v t" . git-timemachine-toggle))
|
("C-x v t" . git-timemachine-toggle))
|
||||||
|
|
||||||
(use-package vc
|
(use-feature vc
|
||||||
:bind
|
:bind
|
||||||
(("C-x v C-r" . my/vc-refresh-state)
|
(("C-x v C-r" . my/vc-refresh-state)
|
||||||
("C-x v C-m" . my/update-git-master))
|
("C-x v C-m" . my/update-git-master))
|
||||||
|
@ -328,8 +328,7 @@ GitHub/Bitbucket/GitLab/... The URL will be added to the kill ring. If
|
||||||
("C-c g c" . git-link-commit)
|
("C-c g c" . git-link-commit)
|
||||||
("C-c g b" . git-link-branch))
|
("C-c g b" . git-link-branch))
|
||||||
|
|
||||||
(use-package git-related
|
(use-feature git-related
|
||||||
:straight nil
|
|
||||||
:defer 10)
|
:defer 10)
|
||||||
|
|
||||||
(provide 'init-git)
|
(provide 'init-git)
|
||||||
|
|
|
@ -15,32 +15,32 @@
|
||||||
("C-=" . easy-mark)
|
("C-=" . easy-mark)
|
||||||
(:map easy-kill-base-map ("C-=" . easy-kill-expand)))
|
(:map easy-kill-base-map ("C-=" . easy-kill-expand)))
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:hook
|
:hook
|
||||||
(emacs-startup . (lambda ()
|
(elpaca-after-init . (lambda ()
|
||||||
;; Based on code in prelude-editor.el
|
;; Based on code in prelude-editor.el
|
||||||
(defun yank-advised-indent-function (beg end)
|
(defun yank-advised-indent-function (beg end)
|
||||||
"Do indentation, as long as the region isn't too large."
|
"Do indentation, as long as the region isn't too large."
|
||||||
(if (<= (- end beg) 10000)
|
(if (<= (- end beg) 10000)
|
||||||
(indent-region beg end nil)))
|
(indent-region beg end nil)))
|
||||||
|
|
||||||
(defmacro advise-commands (advice-name commands class &rest body)
|
(defmacro advise-commands (advice-name commands class &rest body)
|
||||||
"Apply advice named ADVICE-NAME to multiple COMMANDS.
|
"Apply advice named ADVICE-NAME to multiple COMMANDS.
|
||||||
|
|
||||||
The body of the advice is in BODY."
|
The body of the advice is in BODY."
|
||||||
`(progn
|
`(progn
|
||||||
,@(mapcar (lambda (command)
|
,@(mapcar (lambda (command)
|
||||||
`(defadvice ,command (,class ,(intern (concat (symbol-name command) "-" advice-name)) activate)
|
`(defadvice ,command (,class ,(intern (concat (symbol-name command) "-" advice-name)) activate)
|
||||||
,@body))
|
,@body))
|
||||||
commands)))
|
commands)))
|
||||||
|
|
||||||
(advise-commands "indent" (yank yank-pop) after
|
(advise-commands "indent" (yank yank-pop) after
|
||||||
(if (and (not (ad-get-arg 0))
|
(if (and (not (ad-get-arg 0))
|
||||||
(not (member major-mode '(conf-mode coffee-mode haml-mode python-mode slim-mode yaml-mode)))
|
(not (member major-mode '(conf-mode coffee-mode haml-mode python-mode slim-mode yaml-mode)))
|
||||||
(or (derived-mode-p 'prog-mode)
|
(or (derived-mode-p 'prog-mode)
|
||||||
(member major-mode '(LaTeX-mode TeX-mode))))
|
(member major-mode '(LaTeX-mode TeX-mode))))
|
||||||
(let ((transient-mark-mode nil))
|
(let ((transient-mark-mode nil))
|
||||||
(yank-advised-indent-function (region-beginning) (region-end))))))))
|
(yank-advised-indent-function (region-beginning) (region-end))))))))
|
||||||
|
|
||||||
(provide 'init-kill)
|
(provide 'init-kill)
|
||||||
;;; init-kill.el ends here
|
;;; init-kill.el ends here
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
:straight (vertico :files (:defaults "extensions/*")
|
:elpaca (vertico :files (:defaults "extensions/*")
|
||||||
:includes (vertico-directory vertico-repeat vertico-indexed vertico-quick))
|
:includes (vertico-directory vertico-repeat vertico-indexed vertico-quick))
|
||||||
:hook (emacs-startup . vertico-mode)
|
:hook (elpaca-after-init . vertico-mode)
|
||||||
:custom (vertico-cycle t)
|
:custom (vertico-cycle t)
|
||||||
:config
|
:config
|
||||||
;; Do not allow the cursor in the minibuffer prompt
|
;; Do not allow the cursor in the minibuffer prompt
|
||||||
|
@ -43,20 +43,6 @@
|
||||||
" ")
|
" ")
|
||||||
cand)))
|
cand)))
|
||||||
|
|
||||||
(defun define-vertico-key (key &rest defs)
|
|
||||||
"Define KEY conditionally in the vertico keymap.
|
|
||||||
DEFS is a plist associating completion categories to commands."
|
|
||||||
(let ((default-command (lookup-key vertico-map (kbd key))))
|
|
||||||
(define-key vertico-map (kbd key)
|
|
||||||
(list 'menu-item nil defs :filter
|
|
||||||
(lambda (d)
|
|
||||||
(or (plist-get d (completion-metadata-get
|
|
||||||
(completion-metadata (minibuffer-contents)
|
|
||||||
minibuffer-completion-table
|
|
||||||
minibuffer-completion-predicate)
|
|
||||||
'category))
|
|
||||||
default-command))))))
|
|
||||||
|
|
||||||
(defun down-from-outside ()
|
(defun down-from-outside ()
|
||||||
"Move to next candidate in minibuffer, even when minibuffer isn't selected."
|
"Move to next candidate in minibuffer, even when minibuffer isn't selected."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -95,8 +81,7 @@ DEFS is a plist associating completion categories to commands."
|
||||||
("C-M-S-g" . minibuffer-really-quit)
|
("C-M-S-g" . minibuffer-really-quit)
|
||||||
(:map vertico-map ("M-RET" . minibuffer-force-complete-and-exit))))
|
(:map vertico-map ("M-RET" . minibuffer-force-complete-and-exit))))
|
||||||
|
|
||||||
(use-feature vertico-directory
|
(use-extension vertico vertico-directory
|
||||||
:after vertico
|
|
||||||
:config
|
:config
|
||||||
(defvar switching-project nil)
|
(defvar switching-project nil)
|
||||||
(defun vertico-directory-enter-or-select-project ()
|
(defun vertico-directory-enter-or-select-project ()
|
||||||
|
@ -124,6 +109,21 @@ DEFS is a plist associating completion categories to commands."
|
||||||
(apply orig args)))
|
(apply orig args)))
|
||||||
(advice-add 'project-prompt-project-dir :around
|
(advice-add 'project-prompt-project-dir :around
|
||||||
'read-project)
|
'read-project)
|
||||||
|
|
||||||
|
;; TODO this should be part of the vertico config
|
||||||
|
(defun define-vertico-key (key &rest defs)
|
||||||
|
"Define KEY conditionally in the vertico keymap.
|
||||||
|
DEFS is a plist associating completion categories to commands."
|
||||||
|
(let ((default-command (lookup-key vertico-map (kbd key))))
|
||||||
|
(define-key vertico-map (kbd key)
|
||||||
|
(list 'menu-item nil defs :filter
|
||||||
|
(lambda (d)
|
||||||
|
(or (plist-get d (completion-metadata-get
|
||||||
|
(completion-metadata (minibuffer-contents)
|
||||||
|
minibuffer-completion-table
|
||||||
|
minibuffer-completion-predicate)
|
||||||
|
'category))
|
||||||
|
default-command))))))
|
||||||
(define-vertico-key "/"
|
(define-vertico-key "/"
|
||||||
'file #'vertico-directory-slash
|
'file #'vertico-directory-slash
|
||||||
'project-file #'vertico-directory-slash)
|
'project-file #'vertico-directory-slash)
|
||||||
|
@ -142,7 +142,8 @@ DEFS is a plist associating completion categories to commands."
|
||||||
;; Tidy shadowed file names
|
;; Tidy shadowed file names
|
||||||
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||||
|
|
||||||
(use-feature vertico-repeat
|
(use-extension vertico vertico-repeat
|
||||||
|
:after savehist
|
||||||
:bind
|
:bind
|
||||||
("C-\\" . vertico-repeat)
|
("C-\\" . vertico-repeat)
|
||||||
("C-|" . vertico-repeat-select)
|
("C-|" . vertico-repeat-select)
|
||||||
|
@ -442,7 +443,7 @@ DEFS is a plist associating completion categories to commands."
|
||||||
(use-package consult-project-extra)
|
(use-package consult-project-extra)
|
||||||
|
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:hook (emacs-startup . marginalia-mode)
|
:hook (elpaca-after-init . marginalia-mode)
|
||||||
:config
|
:config
|
||||||
;; crux-recentf-find-file
|
;; crux-recentf-find-file
|
||||||
(add-to-list 'marginalia-prompt-categories '("Choose recent file" . file)))
|
(add-to-list 'marginalia-prompt-categories '("Choose recent file" . file)))
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
(use-package envrc
|
(use-package envrc
|
||||||
:diminish
|
:diminish
|
||||||
:hook (after-init . envrc-global-mode))
|
:hook (elpaca-after-init . envrc-global-mode))
|
||||||
|
|
||||||
(use-package restclient
|
(use-package restclient
|
||||||
:mode (("\\.http\\'" . restclient-mode)))
|
:mode (("\\.http\\'" . restclient-mode)))
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
;(size-indication-mode t) ; TODO
|
;(size-indication-mode t) ; TODO
|
||||||
|
|
||||||
(use-feature which-func
|
(use-feature which-func
|
||||||
:hook (after-init . which-function-mode))
|
:hook (elpaca-after-init . which-function-mode))
|
||||||
|
|
||||||
(use-package simple-modeline
|
(use-package simple-modeline
|
||||||
:hook (after-init . simple-modeline-mode)
|
:hook (elpaca-after-init . simple-modeline-mode)
|
||||||
:custom
|
:custom
|
||||||
(simple-modeline-segments
|
(simple-modeline-segments
|
||||||
'((simple-modeline-segment-modified
|
'((simple-modeline-segment-modified
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
(dolist (mode smartscan-exclude-modes)
|
(dolist (mode smartscan-exclude-modes)
|
||||||
(add-hook (intern (concat (symbol-name mode) "-hook")) #'turn-off-smartscan-mode))
|
(add-hook (intern (concat (symbol-name mode) "-hook")) #'turn-off-smartscan-mode))
|
||||||
:hook
|
:hook
|
||||||
(after-init . global-smartscan-mode)
|
(elpaca-after-init . global-smartscan-mode)
|
||||||
:bind (:map smartscan-map
|
:bind (:map smartscan-map
|
||||||
("C-M-'" . smartscan-symbol-replace)))
|
("C-M-'" . smartscan-symbol-replace)))
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ Or remove all highlighted symbols in the current buffer (with`ARG')."
|
||||||
(use-package goto-last-point
|
(use-package goto-last-point
|
||||||
:diminish
|
:diminish
|
||||||
:custom (goto-last-point-max-length 100)
|
:custom (goto-last-point-max-length 100)
|
||||||
:hook (emacs-startup . goto-last-point-mode)
|
:hook (elpaca-after-init . goto-last-point-mode)
|
||||||
:config
|
:config
|
||||||
(defvar goto-last-point-repeat-map
|
(defvar goto-last-point-repeat-map
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
|
|
|
@ -2,37 +2,65 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(setq straight-use-package-by-default t
|
(defvar elpaca-installer-version 0.4)
|
||||||
straight-vc-git-default-clone-depth 1
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
straight-check-for-modifications '(find-when-checking check-on-save)
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
use-package-always-defer t
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
||||||
package-native-compile t)
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||||
|
:ref nil
|
||||||
|
:files (:defaults (:exclude "extensions"))
|
||||||
|
:build (:not elpaca--activate-package)))
|
||||||
|
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
||||||
|
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||||
|
(order (cdr elpaca-order))
|
||||||
|
(default-directory repo))
|
||||||
|
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
||||||
|
(unless (file-exists-p repo)
|
||||||
|
(make-directory repo t)
|
||||||
|
(when (< emacs-major-version 28) (require 'subr-x))
|
||||||
|
(condition-case-unless-debug err
|
||||||
|
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
|
||||||
|
((zerop (call-process "git" nil buffer t "clone"
|
||||||
|
(plist-get order :repo) repo)))
|
||||||
|
((zerop (call-process "git" nil buffer t "checkout"
|
||||||
|
(or (plist-get order :ref) "--"))))
|
||||||
|
(emacs (concat invocation-directory invocation-name))
|
||||||
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
|
||||||
|
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
|
||||||
|
((require 'elpaca))
|
||||||
|
((elpaca-generate-autoloads "elpaca" repo)))
|
||||||
|
(kill-buffer buffer)
|
||||||
|
(error "%s" (with-current-buffer buffer (buffer-string))))
|
||||||
|
((error) (warn "%s" err) (delete-directory repo 'recursive))))
|
||||||
|
(unless (require 'elpaca-autoloads nil t)
|
||||||
|
(require 'elpaca)
|
||||||
|
(elpaca-generate-autoloads "elpaca" repo)
|
||||||
|
(load "./elpaca-autoloads")))
|
||||||
|
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||||
|
(elpaca `(,@elpaca-order))
|
||||||
|
|
||||||
(defvar bootstrap-version)
|
;; Install use-package support
|
||||||
(let ((bootstrap-file
|
(elpaca elpaca-use-package
|
||||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
;; Enable :elpaca use-package keyword.
|
||||||
(bootstrap-version 6))
|
(elpaca-use-package-mode)
|
||||||
(unless (file-exists-p bootstrap-file)
|
;; Assume :elpaca t unless otherwise specified.
|
||||||
(with-current-buffer
|
(setq elpaca-use-package-by-default t
|
||||||
(url-retrieve-synchronously
|
use-package-always-defer t
|
||||||
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
package-native-compile t))
|
||||||
'silent 'inhibit-cookies)
|
|
||||||
(goto-char (point-max))
|
|
||||||
(eval-print-last-sexp)))
|
|
||||||
(load bootstrap-file nil 'nomessage))
|
|
||||||
|
|
||||||
(straight-use-package 'use-package)
|
(elpaca diminish)
|
||||||
|
|
||||||
|
;; Block until current queue processed.
|
||||||
|
(elpaca-wait)
|
||||||
|
|
||||||
;; https://github.com/radian-software/radian/blob/e3aad124c8e0cc870ed09da8b3a4905d01e49769/emacs/radian.el#L352
|
;; https://github.com/radian-software/radian/blob/e3aad124c8e0cc870ed09da8b3a4905d01e49769/emacs/radian.el#L352
|
||||||
(defmacro use-feature (name &rest args)
|
(defmacro use-feature (name &rest args)
|
||||||
"Like `use-package', but with `straight-use-package-by-default' disabled.
|
"Like `use-package', but with `elpaca-use-package-by-default' disabled.
|
||||||
`NAME' and `ARGS' are as with `use-package'"
|
`NAME' and `ARGS' are as with `use-package'"
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
`(use-package ,name
|
`(use-package ,name
|
||||||
:straight nil
|
:elpaca nil
|
||||||
,@args))
|
,@args))
|
||||||
(use-feature straight-x
|
|
||||||
:commands (straight-x-fetch-all))
|
|
||||||
|
|
||||||
;; useful for corfu and vertico extensions
|
;; useful for corfu and vertico extensions
|
||||||
(defmacro use-extension (pkg name &rest args)
|
(defmacro use-extension (pkg name &rest args)
|
||||||
|
@ -40,33 +68,11 @@
|
||||||
`PKG' is the name of the package, `NAME' and `ARGS' are as with `use-package'"
|
`PKG' is the name of the package, `NAME' and `ARGS' are as with `use-package'"
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
`(use-package ,name
|
`(use-package ,name
|
||||||
:straight nil
|
:elpaca nil
|
||||||
:after ,pkg
|
:after ,pkg
|
||||||
:demand t
|
:demand t
|
||||||
,@args))
|
,@args))
|
||||||
|
|
||||||
(use-package diminish)
|
|
||||||
|
|
||||||
;; emacs --batch -l "~/.emacs.d/init.el" -f "my/upgrade-packages"
|
|
||||||
(defun my/upgrade-packages ()
|
|
||||||
"Upgrade all packages installed with straight."
|
|
||||||
(interactive)
|
|
||||||
(setq-local force-reload t)
|
|
||||||
(straight-pull-recipe-repositories)
|
|
||||||
(straight-x-fetch-all)
|
|
||||||
(while straight-x-running
|
|
||||||
(sleep-for 1))
|
|
||||||
(straight-merge-all)
|
|
||||||
(straight-check-all)
|
|
||||||
(straight-freeze-versions))
|
|
||||||
|
|
||||||
;; emacs --batch -l "~/.emacs.d/init.el" -f "my/thaw-packages"
|
|
||||||
(defun my/thaw-packages ()
|
|
||||||
"Restore all packages to the versions in the straight lockfile."
|
|
||||||
(interactive)
|
|
||||||
(setq-local force-reload t)
|
|
||||||
(straight-thaw-versions))
|
|
||||||
|
|
||||||
(defun add-to-list* (list-var &rest elts)
|
(defun add-to-list* (list-var &rest elts)
|
||||||
"Add `ELTS' to `LIST-VAR'."
|
"Add `ELTS' to `LIST-VAR'."
|
||||||
(dolist (elt elts)
|
(dolist (elt elts)
|
||||||
|
|
|
@ -136,7 +136,7 @@ mode as the current buffer (or do nothing)."
|
||||||
("C-x C-S-b" . persp-switch-buffer-same-mode)
|
("C-x C-S-b" . persp-switch-buffer-same-mode)
|
||||||
("C-c x x" . persp-switch-last)
|
("C-c x x" . persp-switch-last)
|
||||||
("C-c x ." . persp-switch-quick)
|
("C-c x ." . persp-switch-quick)
|
||||||
:hook (after-init . persp-mode))
|
:hook (elpaca-after-init . persp-mode))
|
||||||
|
|
||||||
(provide 'init-project)
|
(provide 'init-project)
|
||||||
;;; init-project.el ends here
|
;;; init-project.el ends here
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
(sp-autoskip-closing-pair 'always)
|
(sp-autoskip-closing-pair 'always)
|
||||||
(sp-hybrid-kill-entire-symbol t)
|
(sp-hybrid-kill-entire-symbol t)
|
||||||
(sp-hybrid-kill-excessive-whitespace nil)
|
(sp-hybrid-kill-excessive-whitespace nil)
|
||||||
:hook (after-init . (lambda ()
|
:hook (elpaca-after-init . (lambda ()
|
||||||
(smartparens-global-strict-mode)
|
(smartparens-global-strict-mode)
|
||||||
(show-smartparens-global-mode)
|
(show-smartparens-global-mode)
|
||||||
(setq sp-paredit-bindings (delete '("M-?" . sp-convolute-sexp) sp-paredit-bindings))
|
(setq sp-paredit-bindings (delete '("M-?" . sp-convolute-sexp) sp-paredit-bindings))
|
||||||
(require 'smartparens-config)
|
(require 'smartparens-config)
|
||||||
(sp-use-paredit-bindings)))
|
(sp-use-paredit-bindings)))
|
||||||
:config
|
:config
|
||||||
(sp-pair "\"" "\"" :wrap "M-\"")
|
(sp-pair "\"" "\"" :wrap "M-\"")
|
||||||
;; From https://github.com/bodil/emacs.d/blob/master/bodil/bodil-paredit.el
|
;; From https://github.com/bodil/emacs.d/blob/master/bodil/bodil-paredit.el
|
||||||
|
|
|
@ -4,23 +4,22 @@
|
||||||
;; Frame customisations, and disabling of {menu,tool,scoll}-bar-mode done in early-init.el, rather than here
|
;; Frame customisations, and disabling of {menu,tool,scoll}-bar-mode done in early-init.el, rather than here
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:hook
|
:hook
|
||||||
(emacs-startup . (lambda ()
|
(elpaca-after-init . (lambda ()
|
||||||
(cond
|
(cond
|
||||||
((find-font (font-spec :name "iosevka comfy"))
|
((find-font (font-spec :name "iosevka comfy"))
|
||||||
(set-face-attribute 'default nil :font "iosevka comfy"))
|
(set-face-attribute 'default nil :font "iosevka comfy"))
|
||||||
((find-font (font-spec :name "iosevka"))
|
((find-font (font-spec :name "iosevka"))
|
||||||
(set-face-attribute 'default nil :font "iosevka")))
|
(set-face-attribute 'default nil :font "iosevka")))
|
||||||
|
|
||||||
(global-display-line-numbers-mode)
|
(global-display-line-numbers-mode)
|
||||||
(global-hl-line-mode +1)
|
(global-hl-line-mode +1)
|
||||||
|
|
||||||
(global-set-key (kbd "C-x C-S-k") 'kill-this-buffer)))
|
(global-set-key (kbd "C-x C-S-k") 'kill-this-buffer)
|
||||||
(after-init . (lambda ()
|
|
||||||
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
|
|
||||||
(load-theme 'non-modo t)))
|
|
||||||
|
|
||||||
|
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
|
||||||
|
(load-theme 'non-modo t)))
|
||||||
:config
|
:config
|
||||||
;; https://github.com/rougier/elegant-emacs/blob/master/sanity.el
|
;; https://github.com/rougier/elegant-emacs/blob/master/sanity.el
|
||||||
(setq inhibit-startup-screen t
|
(setq inhibit-startup-screen t
|
||||||
|
@ -72,9 +71,9 @@
|
||||||
("FAIL" . "red3")
|
("FAIL" . "red3")
|
||||||
("NOTE" . "DarkOrange2")
|
("NOTE" . "DarkOrange2")
|
||||||
("DEPRECATED" . "yellow")))
|
("DEPRECATED" . "yellow")))
|
||||||
:hook (emacs-startup . global-hl-todo-mode))
|
:hook (elpaca-after-init . global-hl-todo-mode))
|
||||||
|
|
||||||
(use-package whitespace
|
(use-feature whitespace
|
||||||
:diminish
|
:diminish
|
||||||
:custom
|
:custom
|
||||||
(whitespace-line-column 120)
|
(whitespace-line-column 120)
|
||||||
|
@ -101,7 +100,7 @@
|
||||||
(use-package idle-highlight-mode
|
(use-package idle-highlight-mode
|
||||||
:hook (prog-mode . idle-highlight-mode))
|
:hook (prog-mode . idle-highlight-mode))
|
||||||
|
|
||||||
(use-package paren
|
(use-feature paren
|
||||||
:config
|
:config
|
||||||
(show-paren-mode +1))
|
(show-paren-mode +1))
|
||||||
|
|
||||||
|
@ -113,12 +112,16 @@
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook
|
:hook
|
||||||
(text-mode . (lambda () (rainbow-delimiters-mode +1)))
|
(text-mode . (lambda () (rainbow-delimiters-mode +1)))
|
||||||
(prog-mode . (lambda () (rainbow-delimiters-mode +1))))
|
(prog-mode . (lambda () (rainbow-delimiters-mode +1)))
|
||||||
|
(ielm-mode . (lambda () (rainbow-delimiters-mode +1))))
|
||||||
|
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:diminish)
|
:diminish
|
||||||
|
:hook
|
||||||
|
(emacs-lisp-mode . rainbow-mode)
|
||||||
|
(css-mode . rainbow-mode))
|
||||||
|
|
||||||
(use-package repeat
|
(use-feature repeat
|
||||||
:defer 5
|
:defer 5
|
||||||
:config
|
:config
|
||||||
(let ((inhibit-message t))
|
(let ((inhibit-message t))
|
||||||
|
@ -163,8 +166,9 @@
|
||||||
(smartparens-strict-mode)))
|
(smartparens-strict-mode)))
|
||||||
|
|
||||||
(use-package highlight-sexp
|
(use-package highlight-sexp
|
||||||
|
:elpaca (highlight-sexp :host github :repo "daimrod/highlight-sexp")
|
||||||
:diminish
|
:diminish
|
||||||
:custom (hl-sexp-background-color "grey10") ;; grey25 grey30 DarkBlue navy MidnightBlue DarkSlateBlue
|
:custom (hl-sexp-background-color "grey10")
|
||||||
:hook
|
:hook
|
||||||
(emacs-lisp-mode . highlight-sexp-mode)
|
(emacs-lisp-mode . highlight-sexp-mode)
|
||||||
(clojure-mode . highlight-sexp-mode))
|
(clojure-mode . highlight-sexp-mode))
|
||||||
|
|
|
@ -21,11 +21,9 @@
|
||||||
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
|
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)))
|
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)))
|
||||||
|
|
||||||
(use-package css-mode
|
(use-feature css-mode
|
||||||
:custom
|
:custom
|
||||||
(css-indent-offset 2)
|
(css-indent-offset 2))
|
||||||
:config
|
|
||||||
(rainbow-mode +1))
|
|
||||||
|
|
||||||
(use-package scss-mode
|
(use-package scss-mode
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package emacs
|
(use-feature emacs
|
||||||
:custom
|
:custom
|
||||||
(switch-to-buffer-obey-display-actions t)
|
(switch-to-buffer-obey-display-actions t)
|
||||||
:bind
|
:bind
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
(if this-win-2nd (other-window 1))))))
|
(if this-win-2nd (other-window 1))))))
|
||||||
(define-key ctl-x-4-map "t" 'toggle-window-split))
|
(define-key ctl-x-4-map "t" 'toggle-window-split))
|
||||||
|
|
||||||
(use-package winner
|
(use-feature winner
|
||||||
:defer 5
|
:defer 5
|
||||||
:config
|
:config
|
||||||
(winner-mode +1)
|
(winner-mode +1)
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
(dolist (cmd '(winner-undo winner-redo))
|
(dolist (cmd '(winner-undo winner-redo))
|
||||||
(put cmd 'repeat-map 'winner-repeat-map)))
|
(put cmd 'repeat-map 'winner-repeat-map)))
|
||||||
|
|
||||||
(use-package windmove
|
(use-feature windmove
|
||||||
:defer 5
|
:defer 5
|
||||||
:config (windmove-default-keybindings))
|
:config (windmove-default-keybindings))
|
||||||
|
|
||||||
|
@ -98,9 +98,9 @@
|
||||||
help-mode
|
help-mode
|
||||||
helpful-mode
|
helpful-mode
|
||||||
compilation-mode))
|
compilation-mode))
|
||||||
:hook (emacs-startup . (lambda ()
|
:hook (elpaca-after-init . (lambda ()
|
||||||
(popper-mode +1)
|
(popper-mode +1)
|
||||||
(popper-echo-mode +1))))
|
(popper-echo-mode +1))))
|
||||||
|
|
||||||
(use-package frog-jump-buffer
|
(use-package frog-jump-buffer
|
||||||
:config
|
:config
|
||||||
|
@ -163,7 +163,7 @@
|
||||||
(let ((inhibit-message t))
|
(let ((inhibit-message t))
|
||||||
(buffer-ring-add (persp-current-name))))
|
(buffer-ring-add (persp-current-name))))
|
||||||
:hook
|
:hook
|
||||||
(emacs-startup . buffer-ring-mode)
|
(elpaca-after-init . buffer-ring-mode)
|
||||||
(persp-created . persp-buffer-ring-create-and-switch)
|
(persp-created . persp-buffer-ring-create-and-switch)
|
||||||
(persp-switch . persp-buffer-ring-switch)
|
(persp-switch . persp-buffer-ring-switch)
|
||||||
:bind
|
:bind
|
||||||
|
|
Loading…
Reference in New Issue