summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el60
1 files changed, 51 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))