From 0b6c006e1a9b6452b03682a45dc946288134df38 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Tue, 1 Mar 2022 18:35:26 -0500 Subject: [PATCH] emacs: Start working on *yet another* config Let's hope this sticks --- emacs/.config/emacs/.gitignore | 4 +++ emacs/.config/emacs/core/em-init.el | 11 +++++++++ emacs/.config/emacs/early-init.el | 38 +++++++++++++++++++++++++++++ emacs/.config/emacs/init.el | 12 +++++++++ 4 files changed, 65 insertions(+) create mode 100644 emacs/.config/emacs/.gitignore create mode 100644 emacs/.config/emacs/core/em-init.el create mode 100644 emacs/.config/emacs/early-init.el create mode 100644 emacs/.config/emacs/init.el diff --git a/emacs/.config/emacs/.gitignore b/emacs/.config/emacs/.gitignore new file mode 100644 index 0000000..e819316 --- /dev/null +++ b/emacs/.config/emacs/.gitignore @@ -0,0 +1,4 @@ +etc +var + +straight diff --git a/emacs/.config/emacs/core/em-init.el b/emacs/.config/emacs/core/em-init.el new file mode 100644 index 0000000..6be25f7 --- /dev/null +++ b/emacs/.config/emacs/core/em-init.el @@ -0,0 +1,11 @@ + +(defvar em-core-dir (file-name-directory load-file-name) + "Core files") + +(defvar em-dir (expand-file-name ".." em-core-dir) + "Emacs configuration root directory") + +(add-to-list 'load-path em-core-dir) + + +(provide 'em-init) diff --git a/emacs/.config/emacs/early-init.el b/emacs/.config/emacs/early-init.el new file mode 100644 index 0000000..4aa619f --- /dev/null +++ b/emacs/.config/emacs/early-init.el @@ -0,0 +1,38 @@ +;; straight.el: Package management +(setq package-enable-at-startup nil) + +(setq straight-vc-git-default-clone-depth 15) + +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + +(setq straight-use-package-by-default t) +(straight-use-package 'use-package) +;; (require 'straight-x) + +;; Garbage collection +(setq gc-cons-threshold most-positive-fixnum + gc-cons-percentage 0.6) + +(add-hook 'emacs-startup-hook + (lambda () + (setq gc-cons-threshold 16777216 + gc-cons-percentage 0.1))) + +;; Startup +(setq frame-inhibit-implied-resize t) +(set-language-environment "UTF-8") ; UTF-8 as default +(setq default-input-method nil) + +;; GUI +(tool-bar-mode -1) diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el new file mode 100644 index 0000000..85c1013 --- /dev/null +++ b/emacs/.config/emacs/init.el @@ -0,0 +1,12 @@ +;; TODO Move most of this into core/ +(setq user-full-name "earnest ma" + user-mail-address "me@earne.link" + calendar-latitude 43.7682 ; Toronto + calendar-longitude -79.4126) + +(use-package no-littering + :demand) + +;; Always load newest byte code +(setq load-prefer-newer t) +(load (concat user-emacs-directory "core/em-init") nil 'nomessage)