improve erc-sasl
[Emacs.git] / init.el
blobdabbbfc0f892e33723ec9ec97223a336d4156135
1 ;;; init.el --- Load the full configuration -*- lexical-binding: t; -*-
2 ;;; Commentary:
4 ;; This file bootstraps the configuration, which is divided into
5 ;; a number of other files.
7 ;;; Code:
9 ;; Produce backtraces when errors occur: can be helpful to diagnose startup issues
10 ;;(setq debug-on-error t)
12 (let ((minver "27.1"))
13 (when (version< emacs-version minver)
14 (error "Emacs v%s or higher is required" minver)))
16 (add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
17 (require 'init-benchmarking) ;; Measure startup time
19 (defconst *spell-check-support-enabled* nil) ;; Enable with t if you prefer
20 (defconst *is-a-mac* (eq system-type 'darwin))
21 (defconst *linux* (or (eq system-type 'gnu/linux) (eq system-type 'linux)))
22 (defconst *windows* (eq system-type 'windows-nt))
25 ;; Adjust garbage collection threshold for early startup (see use of gcmh below)
26 (setq gc-cons-threshold (* 128 1024 1024))
28 ;; Bootstrap config
29 (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
30 (require 'init-utils)
31 (require 'init-site-lisp) ;; Must come before elpa, as it may provide package.el
32 ;; Calls (package-initialize)
33 (require 'init-elpa) ;; Machinery for installing required packages
34 (require 'init-exec-path) ;; Set up $PATH
37 ;; General performance tuning
38 (when (require-package 'gcmh)
39 (setq gcmh-high-cons-threshold (* 128 1024 1024))
40 (add-hook 'after-init-hook (lambda ()
41 (gcmh-mode)
42 (diminish 'gcmh-mode))))
44 (setq jit-lock-defer-time 0)
47 ;; Allow users to provide an optional "init-preload-local.el"
48 (require 'init-preload-local nil t)
50 ;; Load configs for specific features and modes
51 (require-package 'diminish)
52 (maybe-require-package 'scratch)
54 (require 'init-frame-hooks)
55 (require 'init-global)
56 (require 'init-term)
57 (require 'init-themes)
58 (require 'init-dired)
59 (require 'init-uniquify)
60 (require 'init-ibuffer)
61 (require 'init-flycheck)
62 (require 'init-eglot)
63 (require 'init-whitespace)
64 (require 'init-minimap)
65 (require 'init-tabbar)
67 (require 'init-minibuffer)
68 (require 'init-corfu)
69 (require 'init-mmm)
70 (require 'init-neotree)
72 (require 'init-projectile)
74 (require 'init-compile)
75 (require 'init-org)
76 (require 'init-css)
77 (require 'init-docker)
78 (require 'init-markdown)
79 (require 'init-php)
80 (require 'init-python)
81 (require 'init-rails)
82 (require 'init-ruby)
83 (require 'init-rust)
84 (require 'init-yaml)
85 (require 'init-terraform)
86 (require 'init-nix)
88 (require 'init-paredit)
89 (require 'init-lisp)
90 (require 'init-sly)
92 ;; (require 'init-pyim)
94 (require 'init-folding)
95 (require 'init-erc)
97 (when *is-a-mac*
98 (require-package 'osx-location))
99 (maybe-require-package 'dotenv-mode)
101 (when (maybe-require-package 'uptimes)
102 (setq-default uptimes-keep-count 200)
103 (add-hook 'after-init-hook (lambda () (require 'uptimes))))
105 (when (fboundp 'global-eldoc-mode)
106 (add-hook 'after-init-hook 'global-eldoc-mode))
108 (require 'init-direnv)
110 (when (and (require 'treesit nil t)
111 (fboundp 'treesit-available-p)
112 (treesit-available-p))
113 (require 'init-treesitter))
116 ;; Allow access from emacsclient
117 (add-hook 'after-init-hook
118 (lambda ()
119 (require 'server)
120 (unless (server-running-p)
121 (server-start))))
123 ;; Variables configured via the interactive 'customize' interface
124 (when (file-exists-p custom-file)
125 (load custom-file))
127 ;; Allow users to provide an optional "init-local" containing personal settings
128 (require 'init-local nil t)
130 (when *is-a-mac*
131 (delete-file "~/Library/Colors/Emacs.clr"))
133 (provide 'init)
134 ;;; init.el ends here