(Emacs/*)~Shamelessly stole some optimisations from doom
Cut my boot time by 0.2s?!
This commit is contained in:
@@ -252,11 +252,11 @@ use fundamental mode and call it a day.
|
|||||||
(use-package emacs
|
(use-package emacs
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(setq
|
(setq inhibit-startup-screen t
|
||||||
inhibit-startup-screen t
|
inhibit-startup-echo-area-message user-login-name
|
||||||
initial-major-mode 'fundamental-mode
|
initial-major-mode 'fundamental-mode
|
||||||
initial-scratch-message ""
|
initial-scratch-message ""
|
||||||
ring-bell-function 'ignore)
|
ring-bell-function 'ignore)
|
||||||
:config
|
:config
|
||||||
(add-hook
|
(add-hook
|
||||||
'emacs-startup-hook
|
'emacs-startup-hook
|
||||||
|
|||||||
@@ -18,28 +18,49 @@
|
|||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;; Sets up some variables and graphical configuration to make Emacs
|
;; Sets up some variables and graphical configuration to make Emacs less janky
|
||||||
;; less janky looking while loading.
|
;; looking while loading. Shamelessly copies some optimisations from Doom
|
||||||
|
;; Emacs.
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(setq gc-cons-threshold most-positive-fixnum
|
(setq-default auto-mode-case-fold nil
|
||||||
package-enable-at-startup nil
|
bidi-display-reordering 'left-to-right
|
||||||
frame-inhibit-implied-resize nil
|
bidi-inhibit-bpa t
|
||||||
frame-resize-pixelwise t
|
bidi-paragraph-direction 'left-to-right
|
||||||
native-comp-async-jobs-number 4
|
cursor-in-non-selected-windows nil
|
||||||
native-comp-eln-load-path (list (concat user-emacs-directory ".local/native-compile"))
|
fast-but-imprecise-scrolling t
|
||||||
native-comp-always-compile nil
|
frame-inhibit-implied-resize t
|
||||||
native-comp-async-report-warnings-errors 'silent)
|
frame-resize-pixelwise t
|
||||||
|
gc-cons-percentage 1
|
||||||
|
gc-cons-threshold most-positive-fixnum
|
||||||
|
highlight-nonselected-windows nil
|
||||||
|
idle-update-delay 1.0
|
||||||
|
load-prefer-newer noninteractive
|
||||||
|
load-prefer-newer noninteractive
|
||||||
|
native-comp-always-compile nil
|
||||||
|
native-comp-async-jobs-number 4
|
||||||
|
native-comp-async-report-warnings-errors 'silent
|
||||||
|
native-comp-eln-load-path (list (concat user-emacs-directory ".local/native-compile"))
|
||||||
|
package-enable-at-startup nil
|
||||||
|
redisplay-skip-fontification-on-input t)
|
||||||
|
|
||||||
;; don't use x resources lol
|
;; don't use x resources lol
|
||||||
(advice-add #'x-apply-session-resources :override #'ignore)
|
(advice-add #'x-apply-session-resources :override #'ignore)
|
||||||
;; turn off the menu bar, tool bar, scroll bar, fringes
|
;; turn off the menu bar, tool bar, scroll bar, fringes
|
||||||
;; also set the transparency (active inactive)
|
;; also set the transparency (active inactive)
|
||||||
(setq-default
|
(setq-default
|
||||||
default-frame-alist '((menu-bar-lines . 0)
|
default-frame-alist '((menu-bar-lines . 0)
|
||||||
(tool-bar-lines . 0)
|
(tool-bar-lines . 0)
|
||||||
(scroll-bar-lines . 0)
|
(scroll-bar-lines . 0)
|
||||||
(left-fringe . 0)
|
(vertical-scroll-bars . 0)
|
||||||
(right-fringe . 0)
|
(left-fringe . 0)
|
||||||
(alpha . (90 80))))
|
(right-fringe . 0)
|
||||||
(scroll-bar-mode -1)
|
(alpha . (90 80)))
|
||||||
|
menu-bar-mode nil
|
||||||
|
tool-bar-mode nil
|
||||||
|
scroll-bar-mode nil)
|
||||||
|
;; Disable making the tool bar
|
||||||
|
(advice-add #'tool-bar-setup :override #'ignore)
|
||||||
|
;; Even though we disable the startup screen in the config, we need to do this
|
||||||
|
;; to ensure it actually doesn't display it
|
||||||
|
(advice-add #'display-startup-screen :override #'ignore)
|
||||||
|
|||||||
@@ -18,13 +18,11 @@
|
|||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;; Sets up straight, use package and the literate system.
|
;; Sets up straight, use-package and no-littering then loads the literate
|
||||||
|
;; system to get my actual configuration.
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; Before doing anything else, make gc-cons-threshold ridiculously
|
;;; Setup straight
|
||||||
;; high. This makes it so we have as few pauses during init as
|
|
||||||
;; possible.
|
|
||||||
;; Straight
|
|
||||||
(setq straight-disable-native-compile nil
|
(setq straight-disable-native-compile nil
|
||||||
straight-use-package-by-default nil
|
straight-use-package-by-default nil
|
||||||
straight-check-for-modifications 'live)
|
straight-check-for-modifications 'live)
|
||||||
@@ -82,6 +80,7 @@
|
|||||||
(require 'eglot))
|
(require 'eglot))
|
||||||
|
|
||||||
(setq gc-cons-threshold (* 100 1024 1024) ; ~100MiB
|
(setq gc-cons-threshold (* 100 1024 1024) ; ~100MiB
|
||||||
|
gc-cons-percentage 0.1 ; 10% of heap allocation => collect garbage
|
||||||
read-process-output-max (* 5 1024 1024) ; ~5MiB
|
read-process-output-max (* 5 1024 1024) ; ~5MiB
|
||||||
;; FIXME: Problem with memory-report after running Emacs for a
|
;; FIXME: Problem with memory-report after running Emacs for a
|
||||||
;; bit, causes a Lisp nesting error, so I just set it up really
|
;; bit, causes a Lisp nesting error, so I just set it up really
|
||||||
|
|||||||
Reference in New Issue
Block a user