early-init.el 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ;;; early-init.el --- Early Init File -*- lexical-binding: t -*-
  2. ;;; Commentary:
  3. ;;; Code:
  4. (setq gc-cons-threshold most-positive-fixnum
  5. gc-cons-percentage 0.6)
  6. (setq load-prefer-newer t
  7. native-comp-async-report-warnings-errors nil
  8. native-comp-warning-on-missing-source nil
  9. warning-suppress-log-types '((comp) (bytecomp))
  10. byte-compile-verbose nil
  11. byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local obsolete))
  12. (push '(menu-bar-lines . 0) default-frame-alist)
  13. (unless (eq system-type 'darwin) ; causes issues in newer versions of macos
  14. (push '(tool-bar-lines . 0) default-frame-alist))
  15. (push '(vertical-scroll-bars) default-frame-alist)
  16. (when (featurep 'ns)
  17. (push '(ns-transparent-titlebar . t) default-frame-alist))
  18. (setq frame-inhibit-implied-resize t)
  19. (unless (eq system-type 'darwin)
  20. (toggle-frame-maximized)
  21. (add-to-list 'default-frame-alist '(fullscreen . maximized)))
  22. (menu-bar-mode -1)
  23. (when window-system
  24. (tool-bar-mode -1)
  25. (scroll-bar-mode -1)
  26. (tooltip-mode -1)
  27. (horizontal-scroll-bar-mode -1))
  28. ;; Copied from https://github.com/jamescherti/minimal-emacs.d
  29. ;; Some features that are not represented as packages can be found in
  30. ;; `features', but this can be inconsistent. The following enforce consistency:
  31. (if (fboundp #'json-parse-string)
  32. (push 'jansson features))
  33. (if (string-match-p "HARFBUZZ" system-configuration-features) ; no alternative
  34. (push 'harfbuzz features))
  35. (if (bound-and-true-p module-file-suffix)
  36. (push 'dynamic-modules features))
  37. (setq package-enable-at-startup nil)
  38. ;; Some optimizations from doom.el (some of these probably don't belong here!)
  39. (setq auto-mode-case-fold nil)
  40. (setq-default bidi-display-reordering 'left-to-right
  41. bidi-paragraph-direction 'left-to-right)
  42. (setq bidi-inhibit-bpa t)
  43. (setq-default cursor-in-non-selected-windows nil)
  44. (setq highlight-nonselected-windows nil)
  45. (setq fast-but-imprecise-scrolling t)
  46. (setq idle-update-delay 1.0)
  47. (setq inhibit-compacting-font-caches t)
  48. (setq redisplay-skip-fontification-on-input t)
  49. ;; Copied/modified from https://github.com/jamescherti/minimal-emacs.d
  50. (setq ad-redefinition-action 'accept
  51. warning-suppress-types '((lexical-binding))
  52. inhibit-startup-buffer-menu t
  53. inhibit-x-resources t
  54. use-file-dialog nil
  55. use-dialog-box nil)
  56. (advice-add #'display-startup-screen :override #'ignore)
  57. (unless (eq system-type 'darwin)
  58. (setq command-line-ns-option-alist nil))
  59. (unless (memq initial-window-system '(x pgtk))
  60. (setq command-line-x-option-alist nil))
  61. (define-advice load-file (:override (file) silence)
  62. (load file nil 'nomessage))
  63. (define-advice startup--load-user-init-file (:before (&rest _) undo-silence)
  64. (advice-remove #'load-file #'load-file@silence))
  65. ;;; early-init.el ends here