diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/init.el b/init.el index 2eef38e..6fc296b 100644 --- a/init.el +++ b/init.el | |||
@@ -26,26 +26,42 @@ | |||
26 | calendar-location-name "Baton Rouge, LA" | 26 | calendar-location-name "Baton Rouge, LA" |
27 | calendar-latitude 30.4 | 27 | calendar-latitude 30.4 |
28 | calendar-longitude -91.1 | 28 | calendar-longitude -91.1 |
29 | calendar-date-style 'iso) | 29 | calendar-date-style 'iso |
30 | custom-file (expand-file-name "custom.el" acdw/etc-dir)) | ||
30 | 31 | ||
31 | ;; Load newer files first | 32 | ;; Load newer files first |
32 | (setq-default load-prefer-newer t) | 33 | (setq-default load-prefer-newer t) |
33 | 34 | ||
34 | ;; Make C-z more useful | 35 | ;; No littering |
35 | (defvar acdw/leader | 36 | (use-package no-littering |
36 | (let ((map (make-sparse-keymap)) | 37 | :demand |
37 | (c-z (global-key-binding "\C-z"))) | 38 | :init (setq no-littering-etc-directory acdw/etc-dir |
38 | (global-unset-key "\C-z") | 39 | no-littering-var-directory acdw/var-dir)) |
39 | (global-set-key "\C-z" map) | ||
40 | (define-key map "\C-z" c-z) | ||
41 | map) | ||
42 | "A leader key for apps and stuff.") | ||
43 | 40 | ||
44 | (defun when-unfocused (func &rest args) | 41 | (defun when-unfocused (func &rest args) |
45 | "Run FUNC with ARGS iff all frames are out of focus." | 42 | "Run FUNC with ARGS iff all frames are out of focus." |
46 | (when (seq-every-p #'null (mapcar #'frame-focus-state (frame-list))) | 43 | (when (seq-every-p #'null (mapcar #'frame-focus-state (frame-list))) |
47 | (apply func args))) | 44 | (apply func args))) |
48 | 45 | ||
46 | (define-minor-mode acdw/reading-mode | ||
47 | "Make reading comfier." | ||
48 | :lighter " Read" | ||
49 | (if acdw/reading-mode | ||
50 | (progn ;; turn on | ||
51 | (text-scale-increase +1) | ||
52 | (display-fill-column-indicator-mode -1) | ||
53 | (dolist (func '(visual-fill-column-mode | ||
54 | iscroll-mode)) | ||
55 | (when (fboundp func) | ||
56 | (funcall func +1)))) | ||
57 | (progn ;; turn off | ||
58 | (text-scale-increase 0) | ||
59 | (display-fill-column-indicator-mode +1) | ||
60 | (dolist (func '(visual-fill-column-mode | ||
61 | iscroll-mode)) | ||
62 | (when (fboundp func) | ||
63 | (funcall func -1)))))) | ||
64 | |||
49 | ;; Dialogs & alerts | 65 | ;; Dialogs & alerts |
50 | (setq-default use-dialog-box nil) ; Don't use a dialog box | 66 | (setq-default use-dialog-box nil) ; Don't use a dialog box |
51 | (fset 'yes-or-no-p #'y-or-n-p) | 67 | (fset 'yes-or-no-p #'y-or-n-p) |