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 --- init.el | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 init.el (limited to 'init.el') 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 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(+) (limited to 'init.el') 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(+) (limited to 'init.el') 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(+) (limited to 'init.el') 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 (limited to 'init.el') 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