-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.el
executable file
·145 lines (109 loc) · 4.72 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;;; init.el --- Load the full configuration -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Sthenno <sthenno@sthenno.com>
;; This file is not part of GNU Emacs.
;;; Commentary:
;; This is the main initialization file that bootstraps the configuration.
;; It handles core settings, performance optimizations, and loads module-specific
;; configurations from the lisp/ directory.
;;; Code:
;;; Performance Optimizations
;; Increase memory threshold for GC during init
(let ((default-gc-cons-percentage gc-cons-percentage))
(setq gc-cons-percentage 0.6)
(add-hook 'emacs-startup-hook #'(lambda ()
(setq gc-cons-percentage default-gc-cons-percentage)
;; Collect garbage after init
(garbage-collect))
t))
;; Silence GC messages
(setq garbage-collection-messages nil)
;; Process & I/O Optimizations
(setq read-process-output-max (* 4 1024 1024) ; Increase to 4mb
process-adaptive-read-buffering nil ; Disable adaptive buffering
inhibit-compacting-font-caches t ; Don't compact font caches during GC
load-prefer-newer t) ; Prefer newer elisp files
;; Display Engine Optimizations
(setq redisplay-skip-fontification-on-input t ; Skip fontification during input
fast-but-imprecise-scrolling t ; Faster scrolling
frame-inhibit-implied-resize t ; Disable frame resizing
inhibit-message t) ; Do not display messages during init
;; (setq jit-lock-defer-time 0)
;; Reduce rendering/line scan work for Emacs by not rendering cursors or regions in
;; non-focused windows
(setq-default cursor-in-non-selected-windows nil
highlight-nonselected-windows nil)
(setq-default ns-use-proxy-icon nil) ; FIXME: Does not work on emacs-mac
(setq-default frame-title-format "")
;; Better Directory Handling
(setq auto-mode-case-fold nil ; Case-sensitive `auto-mode-alist' lookup
find-file-visit-truename nil ; Don't resolve symlinks
vc-follow-symlinks t) ; Follow symlinks for version control
;; Suppress warnings "Package cl is deprecated"
(setq byte-compile-warnings '(cl-functions))
;; Bidirectional Text Handling
(setq-default bidi-paragraph-direction 'left-to-right
bidi-inhibit-bpa t)
;; Basic startup settings
(setq inhibit-startup-screen t
inhibit-startup-echo-area-message user-login-name
inhibit-default-init t
initial-scratch-message nil)
;;; User Configuration
(setq user-full-name "Sthenno"
user-mail-address "sthenno@sthenno.com")
;;; UI Configuration
;; Disable unnecessary UI elements
(dolist (mode '(tool-bar-mode scroll-bar-mode menu-bar-mode))
(when (fboundp mode) (funcall mode -1)))
;; Custom Startup message
(define-advice display-startup-echo-area-message (:override () sthenno-startup-message)
"Display a custom startup message in the echo area."
(let ((icon "")
(text "Left to Bloom, Bloom to Death"))
(message "%s %s" icon text)))
;;; Package Management
;; Store customizations
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
(cond ((file-exists-p custom-file)
(load custom-file)))
;; Initialize package system
(require 'package)
(setq package-archives
'(("gnu-devel" . "https://elpa.gnu.org/devel/")
("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(unless (bound-and-true-p package--initialized)
(package-initialize))
;;; Core Package Configuration
(require 'use-package)
;; Configure use-package defaults
(setq use-package-expand-minimally t ; Generate minimal code
use-package-enable-imenu-support t ; Better imenu integration
use-package-compute-statistics t) ; See report using `use-package-report'
;; Essential packages
(use-package dash :ensure t :demand t)
(use-package s :ensure t :demand t)
(use-package org
:load-path "site-lisp/org/lisp/"
:demand t)
;;; Load Configuration Modules
(add-to-list 'load-path (locate-user-emacs-file "lisp/"))
;; Define required modules
(defvar sthenno/init-modules '(init-system
init-gui-frames
init-org
init-editing-utils
init-projects
init-temp
init-comp
init-eglot)
"List of configuration modules to load.")
;; Load modules safely
(dolist (module sthenno/init-modules)
(condition-case err
(require module)
(error
(message "Failed to load module \"%s\": %s" module err))))
(provide 'init)
;;; init.el ends here