From 3255fe42431e28c12ee794d7e7fe673d3f65f5c3 Mon Sep 17 00:00:00 2001 From: Mountain Man Date: Sun, 9 Apr 2023 16:48:08 -0400 Subject: Create `early-init.el` and `init.el` files --- early-init.el | 6 ++++++ init.el | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 early-init.el create mode 100644 init.el diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..21ebdea --- /dev/null +++ b/early-init.el @@ -0,0 +1,6 @@ +;;; -*- lexical-binding: t; -*- +;;; init.el +;; +;; Early Init file for MMOSMacs. This is loaded before the GUI and +;; package system are initialized. This should contain only what +;; absolutely must be in Early Init. diff --git a/init.el b/init.el new file mode 100644 index 0000000..c80a169 --- /dev/null +++ b/init.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t; -*- +;;; init.el +;; +;; Main configuration file for MMOSMacs. -- cgit v1.2.3 From f9f89304ba6c0f789ecab08fbc23991a302052e3 Mon Sep 17 00:00:00 2001 From: Mountain Man Date: Sun, 9 Apr 2023 17:51:57 -0400 Subject: Disable superfluous UI elements in Early Init MMOSMacs is a keyboard-centric environment, there is no use for mouse-centric UI elements such as tool-bars and menu-bars. They are now disabled. This is done in Early Init to prevent them from being initialized in the first place, to prevent visual stutter. --- early-init.el | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index 21ebdea..24b53b0 100644 --- a/early-init.el +++ b/early-init.el @@ -1,6 +1,37 @@ ;;; -*- lexical-binding: t; -*- -;;; init.el +;;; early-init.el ;; ;; Early Init file for MMOSMacs. This is loaded before the GUI and ;; package system are initialized. This should contain only what ;; absolutely must be in Early Init. + + +;; --------------------------------------------------------------------- +;;; UI Adjustments +;; --------------- +;; The primary goal of this Section is to prevent Emacs from flashing or +;; stuttering visually on startup. +;; +;; If these customizations were placed in `init.el', as is the norm, +;; Emacs would initialize the UI elements, then make whatever +;; customizations we wrote. +;; +;; By placing the customizations here, they are applied before the UI is +;; initialized, preventing any visual glitches altogether. +;; --------------------------------------------------------------------- + +;; --------------------------------- +;; Disable superfluous UI elements +;; ------------------------------- +;; These UI elements are useless in +;; a keyboard-centric environment. +;; --------------------------------- + +;; Disable the menu bar +(push '(menu-bar-lines . 0) default-frame-alist) + +;; Disable the tool-bar +(push '(tool-bar-lines . 0) default-frame-alist) + +;; Disable scroll bars +(push '(vertical-scroll-bars . 0) default-frame-alist) -- cgit v1.2.3 From ef2ff9814984734d98f9c2f7c58262925a743e91 Mon Sep 17 00:00:00 2001 From: Mountain Man Date: Sun, 9 Apr 2023 18:06:59 -0400 Subject: Maximize frame in Early Init Resizing is a major source of visual glitching on startup. Maximizing the frame during Early Init prevents this. --- early-init.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/early-init.el b/early-init.el index 24b53b0..9b5474f 100644 --- a/early-init.el +++ b/early-init.el @@ -35,3 +35,16 @@ ;; Disable scroll bars (push '(vertical-scroll-bars . 0) default-frame-alist) + + +;; --------------------------------- +;; Maximize frame on startup +;; ------------------------- +;; Resizing is one of the primary +;; sources of visual glitching. +;; --------------------------------- + +(push '(fullscreen . maximized) initial-frame-alist) +(push '(ns-transparent-titlebar . t) default-frame-alist) +(setq frame-inhibit-implied-resize t + frame-resize-pixelwise t) -- cgit v1.2.3 From abcd8909298e5c601804c805be3f561be1f8273f Mon Sep 17 00:00:00 2001 From: Mountain Man Date: Sun, 9 Apr 2023 18:20:35 -0400 Subject: Set a black background in Early Init Whoever decided to use white for everything deserve a stern talking-to. Black should be the default background for everything. --- early-init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/early-init.el b/early-init.el index 9b5474f..37222a4 100644 --- a/early-init.el +++ b/early-init.el @@ -48,3 +48,13 @@ (push '(ns-transparent-titlebar . t) default-frame-alist) (setq frame-inhibit-implied-resize t frame-resize-pixelwise t) + + +;; --------------------------------- +;; Start with a black background +;; ----------------------------- +;; This is necessary to prevent eye +;; damage +;; --------------------------------- + +(set-face-attribute 'default nil :background "#000000" :foreground "#FFFFFF") -- cgit v1.2.3 From 8463bcd2cc93b961e771e26761109eb047070bd7 Mon Sep 17 00:00:00 2001 From: Mountain Man Date: Sun, 9 Apr 2023 19:30:24 -0400 Subject: Disable backups, auto-saves, and lockfiles I hate seeing a bunch of `FILES~` and `#FILES#` laying around everywhere. This disables them completely (I think). --- init.el | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/init.el b/init.el index c80a169..302aad5 100644 --- a/init.el +++ b/init.el @@ -2,3 +2,42 @@ ;;; init.el ;; ;; Main configuration file for MMOSMacs. + + +;; --------------------------------------------------------------------- +;;; File Management +;; ---------------- +;; Everything to do with file or directory management goes here. +;; --------------------------------------------------------------------- + +;; --------------------------------- +;; Disable backups +;; --------------- +;; By default, Emacs saves backup +;; files, adding a `~' to the name. +;; Stop saving them. +;; --------------------------------- + +(setq backup-inhibited t) + + +;; --------------------------------- +;; Disable auto-saves +;; ------------------ +;; Auto-saves are the files with +;; hashes before and after the name. +;; They should not exist. +;; --------------------------------- + +(setq auto-save-default nil) + + +;; --------------------------------- +;; Disable lockfiles +;; ----------------- +;; Sometimes I want to edit a locked +;; file. I can handle myself, let me +;; do what I want. +;; --------------------------------- + +(setq create-lockfiles nil) -- cgit v1.2.3 From 821cd3f496503cdb7654f3faf08e06445971cfd7 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:52:04 -0400 Subject: Fix ESC key behavior By default the ESC key has bizarre behavior. Sometimes it quits the thing you're doing, sometimes it completely removes your window layout. This fixes the issue by defining a new version of `keyboard-escape-quit` and removing the keybing for `ESC ESC`. --- init.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/init.el b/init.el index 302aad5..1b2ac9d 100644 --- a/init.el +++ b/init.el @@ -41,3 +41,54 @@ ;; --------------------------------- (setq create-lockfiles nil) + + + + +;; --------------------------------------------------------------------- +;;; Keybinds +;; --------- +;; For now, just a few simple changes. +;; In the future there will be whole custom keybind system. +;; --------------------------------------------------------------------- + +;; --------------------------------- +;; Fix ESC behavior +;; ---------------- +;; The default behavior of the ESC +;; key is atrocious. Why in God's +;; name would I want it to close all +;; my windows when I press it twice? +;; +;; This fixes the behavior to do +;; what ESC should do: "escape" the +;; current thing I'm doing, like the +;; minibuffer or a popup window. +;; --------------------------------- + +;; Define fixed version of `keyboard-escape-quit' which does not close +;; windows or change their layout. +(defun mm/keyboard-escape-quit-keep-windows () + "Alternative version of `keyboard-escape-quit' that does not change window layout." + (interactive) + (cond ((eq last-command 'mode-exited) nil) + ((region-active-p) + (deactivate-mark)) + ((> (minibuffer-depth) 0) + (abort-recursive-edit)) + (current-prefix-arg + nil) + ((> (recursion-depth) 0) + (exit-recursive-edit)) + (buffer-quit-function + (funcall buffer-quit-function)) + ;; The following lines are from `keyboard-escape-quit'. + ;; They have been commented to disable the unwanted behavior + ;; ((not (one-window-p t)) + ;; (delete-other-windows) + ((string-match "^ \\*" (buffer-name (current-buffer))) + bury-buffer))) + +;; Fix the keybinds for the ESC key +(global-set-key (kbd "") 'mm/keyboard-escape-quit-keep-windows) +(global-unset-key (kbd "C-x ESC ESC")) -- cgit v1.2.3 From 63f28fafe4a471fb6cd88f5ebe562d7d15083d3d Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:55:48 -0400 Subject: Replace yes/no prompts with y/n --- init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.el b/init.el index 1b2ac9d..b6a1837 100644 --- a/init.el +++ b/init.el @@ -92,3 +92,15 @@ ;; Fix the keybinds for the ESC key (global-set-key (kbd "") 'mm/keyboard-escape-quit-keep-windows) (global-unset-key (kbd "C-x ESC ESC")) + + +;; --------------------------------- +;; Replace yes/no prompts with y/n +;; ------------------------------- +;; It's too much to ask for me to +;; type 3 whole letters to confirm +;; something. I demand to only have +;; to press a single key. +;; --------------------------------- + +(defalias 'yes-or-no-p 'y-or-n-p) -- cgit v1.2.3 From 926d1b09711ddd8d8d03a2b43bcb147d2d92d4c5 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Sun, 9 Apr 2023 20:02:36 -0400 Subject: Don't create the `auto-save-list` directory By default, Emacs creates an `auto-save-list/` directory in `.emacs.d`. Since we're not saving those auto-saves, there's no need for there to be a directory for them. --- .gitignore | 0 ...-trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln | Bin 0 -> 15920 bytes init.el | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100755 eln-cache/28.2-64ac1258/subr--trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/eln-cache/28.2-64ac1258/subr--trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln b/eln-cache/28.2-64ac1258/subr--trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln new file mode 100755 index 0000000..fc27aca Binary files /dev/null and b/eln-cache/28.2-64ac1258/subr--trampoline-7965732d6f722d6e6f2d70_yes_or_no_p_0.eln differ diff --git a/init.el b/init.el index b6a1837..ba7a20e 100644 --- a/init.el +++ b/init.el @@ -29,7 +29,8 @@ ;; They should not exist. ;; --------------------------------- -(setq auto-save-default nil) +(setq auto-save-default nil ; don't create auto-saves + auto-save-list-file-prefix nil) ; don't create auto-save-list dir ;; --------------------------------- -- cgit v1.2.3