Optimize emacs
This commit is contained in:
@@ -7,7 +7,8 @@
|
|||||||
'(custom-safe-themes
|
'(custom-safe-themes
|
||||||
'("b3db0d7354ef14156b4d16d406b85ef4441e45a54841e11a49d6bc4933eebf58"
|
'("b3db0d7354ef14156b4d16d406b85ef4441e45a54841e11a49d6bc4933eebf58"
|
||||||
default))
|
default))
|
||||||
'(org-agenda-files '("~/org/workout.org")))
|
'(org-agenda-files '("~/org/workout.org"))
|
||||||
|
'(package-selected-packages nil))
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
;; custom-set-faces was added by Custom.
|
;; custom-set-faces was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
|
|
||||||
|
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
|
(setq use-package-enable-imenu-support t)
|
||||||
|
|
||||||
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
|
(prefer-coding-system 'utf-8)
|
||||||
|
;; Inhibit resizing frame
|
||||||
|
(setq frame-inhibit-implied-resize t)
|
||||||
|
|
||||||
|
;; Faster to disable these here (before they've been initialized)
|
||||||
|
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||||
|
(push '(tool-bar-lines . 0) default-frame-alist)
|
||||||
|
(push '(vertical-scroll-bars) default-frame-alist)
|
||||||
|
(when (featurep 'ns)
|
||||||
|
(push '(ns-transparent-titlebar . t) default-frame-alist)
|
||||||
|
(push '(ns-appearance . dark) default-frame-alist))
|
||||||
|
|
||||||
|
;; Prevent flash of unstyled mode line
|
||||||
|
(setq mode-line-format nil)
|
||||||
|
|
||||||
|
|||||||
85
init.el
85
init.el
@@ -1,78 +1,25 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
;;;;;;;;;;;; elpaca initialise ;;;;;;;;;;;;;;;;;;
|
;; Optimize Garbage Collection for Startup
|
||||||
(defvar elpaca-installer-version 0.11)
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
|
||||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
|
||||||
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
|
||||||
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
|
||||||
:ref nil :depth 1 :inherit ignore
|
|
||||||
:files (:defaults "elpaca-test.el" (: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 (apply #'call-process `("git" nil ,buffer t "clone"
|
|
||||||
,@(when-let* ((depth (plist-get order :depth)))
|
|
||||||
(list (format "--depth=%d" depth) "--no-single-branch"))
|
|
||||||
,(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)))
|
|
||||||
(progn (message "%s" (buffer-string)) (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)
|
|
||||||
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
|
|
||||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
|
||||||
(elpaca `(,@elpaca-order))
|
|
||||||
|
|
||||||
;; Install a package via the elpaca macro
|
;; Optimize `auto-mode-alist`
|
||||||
;; See the "recipes" section of the manual for more details.
|
(setq auto-mode-case-fold nil)
|
||||||
|
(unless (or (daemonp) noninteractive init-file-debug)
|
||||||
;; (elpaca example-package)
|
;; Temporarily suppress file-handler processing to speed up startup
|
||||||
|
(let ((default-handlers file-name-handler-alist))
|
||||||
;; Install use-package support
|
(setq file-name-handler-alist nil)
|
||||||
(elpaca elpaca-use-package
|
;; Recover handlers after startup
|
||||||
;; Enable use-package :ensure support for Elpaca.
|
(add-hook 'emacs-startup-hook
|
||||||
(elpaca-use-package-mode))
|
(lambda ()
|
||||||
|
(setq file-name-handler-alist
|
||||||
;;When installing a package used in the init file itself,
|
(delete-dups (append file-name-handler-alist default-handlers))))
|
||||||
;;e.g. a package which adds a use-package key word,
|
101)))
|
||||||
;;use the :wait recipe keyword to block until that package is installed/configured.
|
|
||||||
;;For example:
|
|
||||||
;;(use-package general :ensure (:wait t) :demand t)
|
|
||||||
|
|
||||||
(setq use-package-always-ensure t
|
|
||||||
use-package-expand-minimally t
|
|
||||||
use-package-always-defer t
|
|
||||||
use-package-enable-imenu-support t)
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(use-package benchmark-init
|
|
||||||
:ensure t
|
|
||||||
:demand t
|
|
||||||
:config
|
|
||||||
;; To disable collection of benchmark data after init is done.
|
|
||||||
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
|
||||||
|
|
||||||
|
|
||||||
(add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory))
|
(add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory))
|
||||||
|
(require 'init-elpaca)
|
||||||
|
|
||||||
(require 'init-better-default)
|
(require 'init-better-default)
|
||||||
(require 'init-completion)
|
(require 'init-completion)
|
||||||
(require 'init-meow)
|
(require 'init-meow)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
(tool-bar-mode -1)
|
|
||||||
(scroll-bar-mode -1)
|
|
||||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
||||||
(add-hook 'org-mode-hook #'display-line-numbers-mode)
|
(add-hook 'org-mode-hook #'display-line-numbers-mode)
|
||||||
(setq-default cursor-type 'bar)
|
(setq-default cursor-type 'bar)
|
||||||
@@ -32,4 +31,11 @@
|
|||||||
:config
|
:config
|
||||||
(ultra-scroll-mode 1))
|
(ultra-scroll-mode 1))
|
||||||
|
|
||||||
|
(use-package benchmark-init
|
||||||
|
:ensure t
|
||||||
|
:demand t
|
||||||
|
:config
|
||||||
|
;; To disable collection of benchmark data after init is done.
|
||||||
|
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
||||||
|
|
||||||
(provide 'init-better-default)
|
(provide 'init-better-default)
|
||||||
|
|||||||
67
lisp/init-elpaca.el
Normal file
67
lisp/init-elpaca.el
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;;;;;;;;;; elpaca initialise ;;;;;;;;;;;;;;;;;;
|
||||||
|
(defvar elpaca-installer-version 0.11)
|
||||||
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
||||||
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||||
|
:ref nil :depth 1 :inherit ignore
|
||||||
|
:files (:defaults "elpaca-test.el" (: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 (apply #'call-process `("git" nil ,buffer t "clone"
|
||||||
|
,@(when-let* ((depth (plist-get order :depth)))
|
||||||
|
(list (format "--depth=%d" depth) "--no-single-branch"))
|
||||||
|
,(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)))
|
||||||
|
(progn (message "%s" (buffer-string)) (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)
|
||||||
|
(let ((load-source-file-function nil)) (load "./elpaca-autoloads"))))
|
||||||
|
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||||
|
(elpaca `(,@elpaca-order))
|
||||||
|
|
||||||
|
;; Install a package via the elpaca macro
|
||||||
|
;; See the "recipes" section of the manual for more details.
|
||||||
|
|
||||||
|
;; (elpaca example-package)
|
||||||
|
|
||||||
|
;; Install use-package support
|
||||||
|
(elpaca elpaca-use-package
|
||||||
|
;; Enable use-package :ensure support for Elpaca.
|
||||||
|
(elpaca-use-package-mode))
|
||||||
|
|
||||||
|
;;When installing a package used in the init file itself,
|
||||||
|
;;e.g. a package which adds a use-package key word,
|
||||||
|
;;use the :wait recipe keyword to block until that package is installed/configured.
|
||||||
|
;;For example:
|
||||||
|
;;(use-package general :ensure (:wait t) :demand t)
|
||||||
|
|
||||||
|
(setq use-package-always-ensure t
|
||||||
|
use-package-expand-minimally t
|
||||||
|
use-package-always-defer t)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(provide 'init-elpaca)
|
||||||
9
recentf
9
recentf
@@ -1,7 +1,14 @@
|
|||||||
;;; Automatically generated by ‘recentf’ on Sun Dec 14 20:41:45 2025.
|
;;; Automatically generated by ‘recentf’ on Sun Dec 14 21:09:06 2025.
|
||||||
|
|
||||||
(setq recentf-list
|
(setq recentf-list
|
||||||
'(
|
'(
|
||||||
|
"~/.emacs.d/init.el"
|
||||||
|
"~/.emacs.d/lisp/init-better-default.el"
|
||||||
|
"~/.emacs.d/lisp/init-elpaca.el"
|
||||||
|
"~/.emacs.d/early-init.el"
|
||||||
|
"/usr/local/share/emacs/30.2/etc/PROBLEMS"
|
||||||
|
"~/.emacs.d/lisp/init-ui.el"
|
||||||
|
"~/.emacs.d/lisp/init-coding.el"
|
||||||
"~/.emacs.d/lisp/init-dashboard.el"
|
"~/.emacs.d/lisp/init-dashboard.el"
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user