aboutsummaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el107
1 files changed, 107 insertions, 0 deletions
diff --git a/init.el b/init.el
new file mode 100644
index 0000000..ba7a20e
--- /dev/null
+++ b/init.el
@@ -0,0 +1,107 @@
1;;; -*- lexical-binding: t; -*-
2;;; init.el
3;;
4;; Main configuration file for MMOSMacs.
5
6
7;; ---------------------------------------------------------------------
8;;; File Management
9;; ----------------
10;; Everything to do with file or directory management goes here.
11;; ---------------------------------------------------------------------
12
13;; ---------------------------------
14;; Disable backups
15;; ---------------
16;; By default, Emacs saves backup
17;; files, adding a `~' to the name.
18;; Stop saving them.
19;; ---------------------------------
20
21(setq backup-inhibited t)
22
23
24;; ---------------------------------
25;; Disable auto-saves
26;; ------------------
27;; Auto-saves are the files with
28;; hashes before and after the name.
29;; They should not exist.
30;; ---------------------------------
31
32(setq auto-save-default nil ; don't create auto-saves
33 auto-save-list-file-prefix nil) ; don't create auto-save-list dir
34
35
36;; ---------------------------------
37;; Disable lockfiles
38;; -----------------
39;; Sometimes I want to edit a locked
40;; file. I can handle myself, let me
41;; do what I want.
42;; ---------------------------------
43
44(setq create-lockfiles nil)
45
46
47
48
49;; ---------------------------------------------------------------------
50;;; Keybinds
51;; ---------
52;; For now, just a few simple changes.
53;; In the future there will be whole custom keybind system.
54;; ---------------------------------------------------------------------
55
56;; ---------------------------------
57;; Fix ESC behavior
58;; ----------------
59;; The default behavior of the ESC
60;; key is atrocious. Why in God's
61;; name would I want it to close all
62;; my windows when I press it twice?
63;;
64;; This fixes the behavior to do
65;; what ESC should do: "escape" the
66;; current thing I'm doing, like the
67;; minibuffer or a popup window.
68;; ---------------------------------
69
70;; Define fixed version of `keyboard-escape-quit' which does not close
71;; windows or change their layout.
72(defun mm/keyboard-escape-quit-keep-windows ()
73 "Alternative version of `keyboard-escape-quit' that does not change window layout."
74 (interactive)
75 (cond ((eq last-command 'mode-exited) nil)
76 ((region-active-p)
77 (deactivate-mark))
78 ((> (minibuffer-depth) 0)
79 (abort-recursive-edit))
80 (current-prefix-arg
81 nil)
82 ((> (recursion-depth) 0)
83 (exit-recursive-edit))
84 (buffer-quit-function
85 (funcall buffer-quit-function))
86 ;; The following lines are from `keyboard-escape-quit'.
87 ;; They have been commented to disable the unwanted behavior
88 ;; ((not (one-window-p t))
89 ;; (delete-other-windows)
90 ((string-match "^ \\*" (buffer-name (current-buffer)))
91 bury-buffer)))
92
93;; Fix the keybinds for the ESC key
94(global-set-key (kbd "<escape>") 'mm/keyboard-escape-quit-keep-windows)
95(global-unset-key (kbd "C-x ESC ESC"))
96
97
98;; ---------------------------------
99;; Replace yes/no prompts with y/n
100;; -------------------------------
101;; It's too much to ask for me to
102;; type 3 whole letters to confirm
103;; something. I demand to only have
104;; to press a single key.
105;; ---------------------------------
106
107(defalias 'yes-or-no-p 'y-or-n-p)