summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-12-05 22:37:41 -0600
committerCase Duckworth2021-12-05 22:37:41 -0600
commit58ab5fc5e29396d12aefa7248402dcb6df742680 (patch)
tree312431f4e0e362ee97714cc7e1969ff99624592d
parentRename +defaults to +emacs (diff)
downloademacs-58ab5fc5e29396d12aefa7248402dcb6df742680.tar.gz
emacs-58ab5fc5e29396d12aefa7248402dcb6df742680.zip
Stuff...
-rw-r--r--init.el60
-rw-r--r--lisp/+pulse.el2
-rw-r--r--lisp/+scratch.el29
-rw-r--r--lisp/+util.el3
4 files changed, 85 insertions, 9 deletions
diff --git a/init.el b/init.el index 2a76b3b..60707af 100644 --- a/init.el +++ b/init.el
@@ -38,6 +38,19 @@
38 (save-buffer))) 38 (save-buffer)))
39 (:hook '+init-add-setup-to-imenu)) 39 (:hook '+init-add-setup-to-imenu))
40 40
41(setup (:require auth-source)
42 (:option auth-sources (list (private/ "authinfo")
43 (private/ "authinfo.gpg")
44 "~/.authinfo"
45 "~/.authinfo.gpg")))
46
47(setup (:require pulse)
48 (:also-load +pulse)
49 (:option pulse-flag nil
50 pulse-delay 0.5
51 pulse-iterations 1)
52 (+pulse-location-mode +1))
53
41(setup calendar 54(setup calendar
42 (require '_location) 55 (require '_location)
43 (:option calendar-location-name _location-name 56 (:option calendar-location-name _location-name
@@ -62,7 +75,8 @@
62 hardlink load move 75 hardlink load move
63 shell touch symlink) 76 shell touch symlink)
64 dired-dwim-target t) 77 dired-dwim-target t)
65 (:bind "TAB" 'dired-subtree-cycle 78 (:bind "<backspace>" 'dired-up-directory
79 "TAB" 'dired-subtree-cycle
66 "i" 'dired-subtree-toggle 80 "i" 'dired-subtree-toggle
67 ")" 'dired-git-info-mode) 81 ")" 'dired-git-info-mode)
68 (:hook 'dired-collapse-mode 82 (:hook 'dired-collapse-mode
@@ -136,13 +150,6 @@
136 'display-fill-column-indicator-mode 150 'display-fill-column-indicator-mode
137 'turn-on-auto-fill)) 151 'turn-on-auto-fill))
138 152
139(setup pulse
140 (:also-load +pulse)
141 (:option pulse-flag nil
142 pulse-delay 0.5
143 pulse-iterations 1)
144 (+pulse-location-mode +1))
145
146(setup text 153(setup text
147 (:hook 'turn-on-auto-fill)) 154 (:hook 'turn-on-auto-fill))
148 155
@@ -358,6 +365,29 @@
358 (with-eval-after-load 'orderless 365 (with-eval-after-load 'orderless
359 (:option consult--regexp-compiler 'consult--orderless-regexp-compiler)))) 366 (:option consult--regexp-compiler 'consult--orderless-regexp-compiler))))
360 367
368(setup (:straight crux)
369 (:global "C-o" 'crux-smart-open-line
370 "M-o" 'crux-other-window-or-switch-buffer
371 "C-x 4 t" 'crux-transpose-windows)
372
373 (el-patch-feature crux)
374 (with-eval-after-load 'crux
375 (el-patch-defun crux-reopen-as-root ()
376 "Find file as root if necessary.
377
378Meant to be used as `find-file-hook'.
379See also `crux-reopen-as-root-mode'."
380 (unless (or
381 ;; This helps fix for `nov-mode', and possibly others.
382 (el-patch-add (null buffer-file-name))
383 (tramp-tramp-file-p buffer-file-name)
384 (equal major-mode 'dired-mode)
385 (not (file-exists-p (file-name-directory buffer-file-name)))
386 (file-writable-p buffer-file-name)
387 (crux-file-owned-by-user-p buffer-file-name))
388 (crux-find-alternate-file-as-root buffer-file-name))))
389 (crux-reopen-as-root-mode +1))
390
361(setup (:straight dictionary) 391(setup (:straight dictionary)
362 (:option dictionary-use-single-buffer t) 392 (:option dictionary-use-single-buffer t)
363 (autoload 'dictionary-search "dictionary" 393 (autoload 'dictionary-search "dictionary"
@@ -393,6 +423,10 @@
393 (:load-after consult embark) 423 (:load-after consult embark)
394 (add-hook 'embark-collect-mode-hook 'consult-preview-at-point-mode)) 424 (add-hook 'embark-collect-mode-hook 'consult-preview-at-point-mode))
395 425
426(setup (:straight eros)
427 (:hook-into emacs-lisp-mode
428 lisp-interaction-mode))
429
396(setup (:straight eshell-syntax-highlighting) 430(setup (:straight eshell-syntax-highlighting)
397 (:hook-into eshell-mode)) 431 (:hook-into eshell-mode))
398 432
@@ -693,7 +727,7 @@
693 727
694(setup (:straight whitespace-cleanup-mode) 728(setup (:straight whitespace-cleanup-mode)
695 (:option whitespace-cleanup-mode-preserve-point t) 729 (:option whitespace-cleanup-mode-preserve-point t)
696 (remove-hook 'before-save-hook 'whitespace-cleanup) 730 ;;(remove-hook 'before-save-hook 'whitespace-cleanup)
697 (global-whitespace-cleanup-mode +1)) 731 (global-whitespace-cleanup-mode +1))
698 732
699(setup (:straight zzz-to-char) 733(setup (:straight zzz-to-char)
@@ -702,3 +736,11 @@
702 (interactive "P") 736 (interactive "P")
703 (call-interactively 737 (call-interactively
704 (if prefix #'zzz-up-to-char #'zzz-to-char))))) 738 (if prefix #'zzz-up-to-char #'zzz-to-char)))))
739
740(setup (:straight scratch)
741 (:also-load +scratch)
742 (:option initial-major-mode 'emacs-lisp-mode
743 initial-scratch-message
744 ";; ABANDON ALL HOPE YE WHO ENTER HERE")
745 (add-hook 'kill-buffer-query-functions '+scratch-immortal)
746 (add-hook 'scratch-create-buffer-hook '+scratch-buffer-setup))
diff --git a/lisp/+pulse.el b/lisp/+pulse.el index 6ba7ded..eefdd83 100644 --- a/lisp/+pulse.el +++ b/lisp/+pulse.el
@@ -2,6 +2,8 @@
2 2
3;;; Code: 3;;; Code:
4 4
5(require 'pulse)
6
5(defgroup +pulse nil 7(defgroup +pulse nil
6 "Extra customizations for `pulse'." 8 "Extra customizations for `pulse'."
7 :group 'pulse 9 :group 'pulse
diff --git a/lisp/+scratch.el b/lisp/+scratch.el new file mode 100644 index 0000000..976b08c --- /dev/null +++ b/lisp/+scratch.el
@@ -0,0 +1,29 @@
1;;; +scratch.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(require 'scratch)
6
7(defun +scratch-immortal ()
8 "Bury, don't kill \"*scratc*\" buffer.
9For `kill-buffer-query-functions'."
10 (if (eq (current-buffer) (get-buffer "*scratch*"))
11 (progn (bury-buffer)
12 nil)
13 t))
14
15(defun +scratch-buffer-setup ()
16 "Add comment to `scratch' buffer and name it accordingly."
17 (let* ((mode (format "%s" major-mode))
18 (string (concat "Scratch buffer for:" mode "\n\n")))
19 (when scratch-buffer
20 (save-excursion
21 (insert string)
22 (goto-char (point-min))
23 (comment-region (point-at-bol) (point-at-eol)))
24 (next-line 2))
25 (rename-buffer (concat "*scratch<" mode ">*") t)))
26
27
28(provide '+scratch)
29;;; +scratch.el ends here
diff --git a/lisp/+util.el b/lisp/+util.el index 0870a71..0184a48 100644 --- a/lisp/+util.el +++ b/lisp/+util.el
@@ -77,5 +77,8 @@ ALIGNMENT can be one of these:
77 (if (eq alignment 'right) "" filler) 77 (if (eq alignment 'right) "" filler)
78 after))) 78 after)))
79 79
80;;; COMMANDS
81
82
80(provide '+util) 83(provide '+util)
81;;; +util.el ends here 84;;; +util.el ends here