Update to 29, make use-package default to defer

This commit is contained in:
eriedaberrie 2022-12-21 17:40:08 -08:00
parent 4cde9a9d76
commit ebcd1aa0f4

136
init.el
View file

@ -5,14 +5,13 @@
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(setq use-package-always-ensure t
use-package-always-defer t
use-package-expand-minimally t)
(require 'use-package)
(use-package gcmh
:demand t
;; :custom
;; (gcmh-high-cons-threshold 40000000)
;; (gcmh-high-cons-threshold most-positive-fixnum)
@ -29,9 +28,10 @@
(setq backup-by-copying t
inhibit-splash-screen t
custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-readable-p custom-file)
(load custom-file))
;; custom-file (expand-file-name "custom.el" user-emacs-directory)
custom-file (expand-file-name "custom.el" temporary-file-directory))
;; (when (file-readable-p custom-file)
;; (load custom-file))
(use-package auto-package-update
:custom
@ -45,8 +45,9 @@
:hook (evil-local-mode . turn-on-undo-tree-mode))
(use-package evil
:demand t
:custom
(x-select-enable-clipboard nil "Disable automatic clipboard=unnamedplus")
(select-enable-clipboard nil "Disable automatic clipboard=unnamedplus")
(evil-want-keybinding nil "Necessary for evil-collection")
(evil-want-Y-yank-to-eol t "Make Y behave like it should")
(evil-want-C-u-scroll t "Scroll with C-u")
@ -63,6 +64,7 @@
(evil-global-set-key 'insert (kbd "C-S-h") #'help-command))
(use-package evil-collection
:demand t
:after evil
:custom
(evil-collection-setup-minibuffer t)
@ -70,6 +72,7 @@
(evil-collection-init))
(use-package evil-leader
:demand t
:after evil
:config
(evil-leader/set-leader "<SPC>")
@ -85,26 +88,29 @@
"f'" #'bookmark-jump
"gg" #'magit-status
"mm" #'minimap-mode
"ps" #'auto-package-update-now
;; "ps" (lambda ()
;; (interactive)
;; (package-refresh-contents)
;; (auto-package-update-now-async))
;; "ps" #'auto-package-update-now
"ps" (lambda ()
(interactive)
(package-refresh-contents)
(auto-package-update-now-async))
"qq" #'evil-quit
"qk" #'kill-emacs)
(global-evil-leader-mode))
(use-package evil-surround
:demand t
:after evil
:config
(global-evil-surround-mode))
(use-package evil-commentary
:demand t
:after evil
:config
(evil-commentary-mode))
(use-package evil-numbers
:demand t
:after evil
:config
(evil-define-key '(normal visual) 'global "g+" #'evil-numbers/inc-at-pt)
@ -113,6 +119,7 @@
(evil-define-key '(normal visual) 'global "g=-" #'evil-numbers/inc-at-pt-incremental))
(use-package evil-replace-with-register
:demand t
:after evil
:custom
(evil-replace-with-register-indent t)
@ -127,6 +134,7 @@
(evil-org-agenda-set-keys))
(use-package evil-goggles
:demand t
:after evil
:custom
(evil-goggles-duration 0.12 "Decrease the duration a tiny bit")
@ -135,8 +143,7 @@
(evil-goggles-use-diff-faces)
(evil-goggles-mode))
(use-package evil-terminal-cursor-changer
:defer t)
(use-package evil-terminal-cursor-changer)
(use-package hydra
:config
@ -146,13 +153,13 @@
("j" #'evil-window-down "down")
("k" #'evil-window-up "up")
("l" #'evil-window-right "right")
("C-w" #'evil-window-next "next")
("+" #'evil-window-increase-height "+height")
("-" #'evil-window-decrease-height "-height")
(">" #'evil-window-increase-width "+width")
("<" #'evil-window-decrease-width "-width")))
(use-package lispy
:after lispyville)
(use-package lispy)
(use-package lispyville
:hook (emacs-lisp-mode
@ -181,12 +188,12 @@
(evil-define-key 'insert lispyville-mode-map "(" #'lispy-parens)
(evil-define-key 'insert lispyville-mode-map ")" #'lispy-right-nostring)
(evil-define-key 'insert lispyville-mode-map "\"" #'lispy-quotes)
(evil-define-key 'normal lispyville-mode-map ";" nil)
(evil-define-key 'normal lispyville-mode-map (kbd "C-;") #'lispy-comment)
(evil-define-key 'visual lispyville-mode-map "iF" #'special-lispy-flow))
(use-package company
:demand t
:custom
(company-idle-delay 0.3)
:config
@ -196,67 +203,45 @@
(define-key company-active-map (kbd "C-?") #'company-show-location)
(global-company-mode))
;; (use-package lsp-mode
;; :commands lsp-mode
;; :custom
;; (lsp-keymap-prefix nil)
;; (lsp-enable-indentation nil)
;; (read-process-output-max (* 1024 1024))
;; :hook ((lsp-mode . evil-normalize-keymaps)
;; (lsp-mode . (lambda ()
;; (let ((lsp-keymap-prefix "SPC e"))
;; (lsp-enable-which-key-integration)))))
;; :config
;; (evil-define-key 'normal lsp-mode-map (kbd "SPC e") lsp-command-map))
;; ;; :hook (((c-mode java-mode) . lsp-deferred))
(use-package dtrt-indent
:demand t
:config
(dtrt-indent-global-mode))
(use-package aggressive-indent
:config
:hook prog-mode
;; :config
;; (add-to-list 'aggressive-indent-dont-indent-if
;; '(member evil-state '(insert replace)))
(global-aggressive-indent-mode))
)
(use-package rainbow-delimiters
:hook prog-mode)
(use-package tree-sitter
:hook (sh-mode
c-mode
c++-mode
css-mode
html-mode
java-mode
js-mode
perl-mode
python-mode
ruby-mode
(tree-sitter-after-on . tree-sitter-hl-mode)))
(use-package tree-sitter-langs
:defer t)
(use-package which-key
:demand t
:custom
(which-key-idle-delay 0.2)
:config
(which-key-mode))
(use-package orderless
:demand t
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion)))))
(use-package marginalia
:demand t
:after vertico
:bind (:map minibuffer-local-map
("M-a" . marginalia-cycle))
:init
:config
(marginalia-mode))
(use-package vertico
:demand t
:config
(evil-define-key 'insert minibuffer-local-map (kbd "C-j") #'vertico-next)
(evil-define-key 'insert minibuffer-local-map (kbd "C-k") #'vertico-previous)
@ -266,7 +251,8 @@
(use-package yasnippet)
(use-package yasnippet-snippets)
(use-package all-the-icons)
(use-package all-the-icons
:demand t)
(use-package all-the-icons-completion
:after (marginalia all-the-icons)
@ -274,15 +260,25 @@
:init
(all-the-icons-completion-mode))
(use-package treemacs)
(use-package treemacs-evil)
(use-package treemacs
:commands treemacs)
(use-package treemacs-evil
:demand t
:after treemacs)
;; (use-package treemacs-icons-dired
;; :hook (dired-mode . treemacs-icons-dired-enable-once))
(use-package treemacs-all-the-icons
:demand t
:after treemacs
:config
(treemacs-load-theme 'all-the-icons))
(use-package doom-modeline
:demand t
:custom
(doom-modeline-fn-alist (--map
(cons (remove-pos-from-symbol (car it)) (cdr it))
doom-modeline-fn-alist))
:config
(doom-modeline-mode))
@ -294,7 +290,6 @@
(dirvish-override-dired-mode))
(use-package pdf-tools
:defer t
:mode (("\\.pdf\\'" . pdf-view-mode))
:config
(pdf-tools-install))
@ -306,7 +301,6 @@
(buffer-face-mode))
(use-package org
:defer t
:mode (("\\.org$" . org-mode))
:hook ((org-mode . org-indent-mode)
(org-mode . flyspell-mode)
@ -332,25 +326,33 @@
:hook (org-mode . org-pdftools-setup-link))
(use-package editorconfig
:demand t
:config
(editorconfig-mode))
(use-package json-mode
:defer t
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'")
(use-package minimap
:defer t
:commands minimap-mode
:custom-face
(minimap-active-region-background ((t (:background nil :inherit hl-line))))
:hook ((minimap-sb-mode . evil-emacs-state)
(minimap-sb-mode . turn-on-solaire-mode)))
(minimap-sb-mode . turn-on-solaire-mode))
:config
(with-eval-after-load "evil"
(defadvice evil-quit (after evil-quit-remove-minimap activate)
(let ((windows (window-list nil 0)))
(when (and (eq (length windows) 1)
(with-current-buffer (window-buffer (car windows))
(member 'minimap-sb-mode local-minor-modes)))
(if (daemonp)
(delete-frame)
(kill-emacs)))))))
(use-package magit)
(use-package tramp
:defer t
:custom
(remote-file-name-inhibit-cache nil)
(tramp-verbose 1)
@ -360,6 +362,7 @@
tramp-file-name-regexp)))
(use-package elfeed
:commands (elfeed elfeed-update)
:custom
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux))))
@ -373,6 +376,7 @@
;; (evil-set-initial-state 'md4rd-mode 'emacs))
(use-package xkcd
:commands xkcd
:config
(evil-set-initial-state 'xkcd-mode 'emacs))
@ -396,13 +400,8 @@
"?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
"\\\\" "://")))
(use-package gruvbox-theme
:defer t)
(use-package catppuccin-theme
;; :custom
;; (catppuccin-use-24-bit-colors-on-256-colors-term t)
:defer t)
(use-package gruvbox-theme)
(use-package catppuccin-theme)
(defun load-theme-with-solaire ()
(load-theme 'catppuccin-macchiato t)
(solaire-global-mode)
@ -410,6 +409,7 @@
(remove-hook 'server-after-make-frame-hook #'load-theme-with-solaire)))
(use-package solaire-mode
:demand t
:custom
(solaire-mode-real-buffer-fn (lambda ()
(and (solaire-mode-real-buffer-p)
@ -423,7 +423,6 @@
(use-package emacs-everywhere
:load-path "~/emacs-everywhere"
:defer t
:commands emacs-everywhere)
(use-package tool-bar
@ -439,6 +438,8 @@
:config
(scroll-bar-mode 0))
(setq pixel-scroll-precision-large-scroll-height 40)
(pixel-scroll-precision-mode)
(global-hl-line-mode)
(add-to-list 'default-frame-alist '(font . "JetbrainsMono Nerd Font-10.5"))
;; (add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-10.5"))
@ -502,7 +503,8 @@
(add-to-list 'auto-mode-alist '("\\.yuck\\'" . lisp-mode))
;; (add-to-list 'default-frame-alist '(internal-border-width . 6))
(add-to-list 'default-frame-alist '(internal-border-width . 6))
(add-to-list 'default-frame-alist '(alpha-background . 0.94))
(with-current-buffer "*scratch*"
(cd "~/"))