Skip to content

Instantly share code, notes, and snippets.

@wakatara
Last active May 26, 2023 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wakatara/f6e0c22cde777c29eee8c9d3b1103e4b to your computer and use it in GitHub Desktop.
Save wakatara/f6e0c22cde777c29eee8c9d3b1103e4b to your computer and use it in GitHub Desktop.
Daryl's emacs early-init.el for speed optimizations
;; early-init.el --- -*- lexical-binding: t -*-
;; Author: Daryl Manning
;; Commentary: Modified from Ian Y.E. Pan
;; Code:
(menu-bar-mode -1)
(unless (and (display-graphic-p) (eq system-type 'darwin))
(push '(menu-bar-lines . 0) default-frame-alist))
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
(setq inhibit-startup-screen t)
(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)
(setq initial-major-mode 'org-mode)
(setq-default indent-tabs-mode nil)
(setq pop-up-windows nil)
(tool-bar-mode -1)
(tooltip-mode -1)
(scroll-bar-mode -1)
(defvar file-name-handler-alist-original file-name-handler-alist)
(setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6
file-name-handler-alist nil
site-run-file nil
read-process-output-max (* 10 1024 1024)
bidi-inhibit-bpa t)
(defvar ian/gc-cons-threshold (* 100 1024 1024))
(add-hook 'emacs-startup-hook ; hook run after loading init files
#'(lambda ()
(setq gc-cons-threshold ian/gc-cons-threshold
gc-cons-percentage 0.1
file-name-handler-alist file-name-handler-alist-original)))
(add-hook 'minibuffer-setup-hook #'(lambda ()
(setq gc-cons-threshold most-positive-fixnum)))
(add-hook 'minibuffer-exit-hook #'(lambda ()
(garbage-collect)
(setq gc-cons-threshold ian/gc-cons-threshold)))
;; Disable package.el in favor of straight.el
(setq package-enable-at-startup nil)
(provide 'early-init)
;;; early-init.el ends here
@doolio
Copy link

doolio commented May 26, 2023

Typo "G" in line 6?

@wakatara
Copy link
Author

wakatara commented May 26, 2023

Thanks @doolio , I obviously fat-fingered something there. :-) (probs neovim since G puts you at the end of the doc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment