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.el133
1 files changed, 109 insertions, 24 deletions
diff --git a/init.el b/init.el index e0cf8ae..5d756cd 100644 --- a/init.el +++ b/init.el
@@ -25,8 +25,7 @@
25 ;; necessary for good functioning. In this block, I add extra 25 ;; necessary for good functioning. In this block, I add extra
26 ;; things or more "experimental" ones that might not belong in a 26 ;; things or more "experimental" ones that might not belong in a
27 ;; separate file. 27 ;; separate file.
28 (:global "M-o" 'other-buffer 28 (:global "C-x C-k" 'kill-this-buffer)
29 "C-x C-k" 'kill-this-buffer)
30 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults 29 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
31 (global-set-key (kbd "C-h") 'delete-backward-char) 30 (global-set-key (kbd "C-h") 'delete-backward-char)
32 (keyboard-translate ?\C-h ?\C-?)) 31 (keyboard-translate ?\C-h ?\C-?))
@@ -39,7 +38,7 @@
39 (:hook '+init-add-setup-to-imenu)) 38 (:hook '+init-add-setup-to-imenu))
40 39
41(setup (:require +key) 40(setup (:require +key)
42 (+key-global-mode +1)) 41 (+key-setup))
43 42
44(setup (:require auth-source) 43(setup (:require auth-source)
45 (:option auth-sources (list (private/ "authinfo") 44 (:option auth-sources (list (private/ "authinfo")
@@ -51,7 +50,8 @@
51 (:also-load +pulse) 50 (:also-load +pulse)
52 (:option pulse-flag nil 51 (:option pulse-flag nil
53 pulse-delay 0.5 52 pulse-delay 0.5
54 pulse-iterations 1) 53 pulse-iterations 1
54 (append +pulse-location-commands) 'lui-track-jump-to-indicator)
55 (+pulse-location-mode +1)) 55 (+pulse-location-mode +1))
56 56
57(setup calendar 57(setup calendar
@@ -168,7 +168,7 @@
168(setup (:straight anzu) 168(setup (:straight anzu)
169 (:option anzu-cons-mode-line-p nil) 169 (:option anzu-cons-mode-line-p nil)
170 (:+key [remap query-replace] 'anzu-query-replace-regexp 170 (:+key [remap query-replace] 'anzu-query-replace-regexp
171 [remap query-replace-regexp] 'anzu-query-replace-regexp) 171 [remap query-replace-regexp] 'anzu-query-replace-regexp)
172 (global-anzu-mode +1) 172 (global-anzu-mode +1)
173 (:bind-into isearch 173 (:bind-into isearch
174 [remap isearch-query-replace] 174 [remap isearch-query-replace]
@@ -206,8 +206,8 @@
206 (circadian-setup)) 206 (circadian-setup))
207 207
208(setup (:straight circe) 208(setup (:straight circe)
209 (:require _circe) 209 (:require _circe
210 (:require +circe) 210 +circe)
211 (autoload '+irc "+circe" "Connect to IRC." t) 211 (autoload '+irc "+circe" "Connect to IRC." t)
212 212
213 ;; Formatting options 213 ;; Formatting options
@@ -315,7 +315,7 @@
315 ("C-M-#" . consult-register) 315 ("C-M-#" . consult-register)
316 ;; Other custom bindings 316 ;; Other custom bindings
317 ("M-y" . consult-yank-pop) 317 ("M-y" . consult-yank-pop)
318 ("<help> a" . consult-apropos) 318 ("<f1> a" . consult-apropos)
319 ;; M-g bindings (goto-map) 319 ;; M-g bindings (goto-map)
320 ("M-g e" . consult-compile-error) 320 ("M-g e" . consult-compile-error)
321 ("M-g f" . consult-flymake) ; or consult-flycheck 321 ("M-g f" . consult-flymake) ; or consult-flycheck
@@ -339,7 +339,7 @@
339 ("M-s u" . consult-focus-lines) 339 ("M-s u" . consult-focus-lines)
340 ;; Isearch integration 340 ;; Isearch integration
341 ("M-s e" . consult-isearch-history))) 341 ("M-s e" . consult-isearch-history)))
342 (global-set-key (kbd (car binding)) (cdr binding))) 342 (define-key +key-mode-map (kbd (car binding)) (cdr binding)))
343 (with-eval-after-load 'isearch-mode 343 (with-eval-after-load 'isearch-mode
344 (dolist (binding '(("M-e" . consult-isearch-history) 344 (dolist (binding '(("M-e" . consult-isearch-history)
345 ("M-s e" . consult-isearch-history) 345 ("M-s e" . consult-isearch-history)
@@ -370,8 +370,8 @@
370 370
371(setup (:straight crux) 371(setup (:straight crux)
372 (:+key "C-o" 'crux-smart-open-line 372 (:+key "C-o" 'crux-smart-open-line
373 "M-o" 'crux-other-window-or-switch-buffer 373 "M-o" 'crux-other-window-or-switch-buffer
374 "C-x 4 t" 'crux-transpose-windows) 374 "C-x 4 t" 'crux-transpose-windows)
375 375
376 (el-patch-feature crux) 376 (el-patch-feature crux)
377 (with-eval-after-load 'crux 377 (with-eval-after-load 'crux
@@ -419,8 +419,8 @@ See also `crux-reopen-as-root-mode'."
419(setup (:straight embark) 419(setup (:straight embark)
420 (:option prefix-help-command 'embark-prefix-help-command) 420 (:option prefix-help-command 'embark-prefix-help-command)
421 (:+key "C-." 'embark-act 421 (:+key "C-." 'embark-act
422 "M-." 'embark-dwim 422 "M-." 'embark-dwim
423 "<help> B" 'embark-bindings)) 423 "<f1> B" 'embark-bindings))
424 424
425(setup (:straight embark-consult) 425(setup (:straight embark-consult)
426 (:load-after consult embark) 426 (:load-after consult embark)
@@ -461,10 +461,12 @@ See also `crux-reopen-as-root-mode'."
461 (gcmh-mode +1)) 461 (gcmh-mode +1))
462 462
463(setup (:straight helpful) 463(setup (:straight helpful)
464 (:+key "<help> f" 'helpful-callable 464 (run-with-idle-timer 0.5 nil
465 "<help> v" 'helpful-variable 465 'require 'helpful)
466 "<help> k" 'helpful-key 466 (:+key "<f1> f" 'helpful-callable
467 "C-c C-d" 'helpful-at-point)) 467 "<f1> v" 'helpful-variable
468 "<f1> k" 'helpful-key
469 "C-c C-d" 'helpful-at-point))
468 470
469(setup (:straight (hippie-completing-read 471(setup (:straight (hippie-completing-read
470 :host github 472 :host github
@@ -531,7 +533,7 @@ See also `crux-reopen-as-root-mode'."
531 533
532(setup (:straight mwim) 534(setup (:straight mwim)
533 (:+key "C-a" #'mwim-beginning 535 (:+key "C-a" #'mwim-beginning
534 "C-e" #'mwim-end)) 536 "C-e" #'mwim-end))
535 537
536(setup (:straight orderless) 538(setup (:straight orderless)
537 (:option completion-styles '(orderless))) 539 (:option completion-styles '(orderless)))
@@ -589,6 +591,7 @@ See also `crux-reopen-as-root-mode'."
589 org-log-into-drawer t 591 org-log-into-drawer t
590 org-outline-path-complete-in-steps nil 592 org-outline-path-complete-in-steps nil
591 org-pretty-entities t 593 org-pretty-entities t
594 org-pretty-entities-include-sub-superscripts nil
592 org-refile-use-outline-path 'file 595 org-refile-use-outline-path 'file
593 org-special-ctrl-a/e t 596 org-special-ctrl-a/e t
594 org-special-ctrl-k t 597 org-special-ctrl-k t
@@ -666,6 +669,7 @@ See also `crux-reopen-as-root-mode'."
666 +modeline-vc 669 +modeline-vc
667 simple-modeline-segment-misc-info 670 simple-modeline-segment-misc-info
668 simple-modeline-segment-process 671 simple-modeline-segment-process
672 +modeline-text-scale
669 +modeline-narrowed 673 +modeline-narrowed
670 +modeline-minions 674 +modeline-minions
671 +modeline-major-mode))) 675 +modeline-major-mode)))
@@ -719,7 +723,7 @@ See also `crux-reopen-as-root-mode'."
719 723
720(setup (:straight undo-fu) 724(setup (:straight undo-fu)
721 (:+key "C-/" #'undo-fu-only-undo 725 (:+key "C-/" #'undo-fu-only-undo
722 "C-?" #'undo-fu-only-redo)) 726 "C-?" #'undo-fu-only-redo))
723 727
724(setup (:straight undo-fu-session) 728(setup (:straight undo-fu-session)
725 (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" 729 (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'"
@@ -730,7 +734,8 @@ See also `crux-reopen-as-root-mode'."
730 734
731(setup (:straight (unfill :host github :repo "purcell/unfill" 735(setup (:straight (unfill :host github :repo "purcell/unfill"
732 :fork (:host github :repo "duckwork/unfill"))) 736 :fork (:host github :repo "duckwork/unfill")))
733 (:+key "M-q" #'unfill-toggle)) 737 (:bind-into text-mode
738 "M-q" #'unfill-toggle))
734 739
735(setup (:straight (vertico 740(setup (:straight (vertico
736 :host github 741 :host github
@@ -765,7 +770,87 @@ See also `crux-reopen-as-root-mode'."
765 770
766(setup (:straight zzz-to-char) 771(setup (:straight zzz-to-char)
767 (:+key "M-z" (lambda (prefix) 772 (:+key "M-z" (lambda (prefix)
768 "Call `zzz-to-char' or `zzz-up-to-char' with PREFIX arg." 773 "Call `zzz-to-char' or `zzz-up-to-char' with PREFIX arg."
769 (interactive "P") 774 (interactive "P")
770 (call-interactively 775 (call-interactively
771 (if prefix #'zzz-up-to-char #'zzz-to-char))))) 776 (if prefix #'zzz-up-to-char #'zzz-to-char)))))
777
778(setup (:straight elfeed)
779 (:also-load +elfeed)
780 (:option elfeed-use-curl t
781 elfeed-curl-extra-arguments '("--insecure")
782 elfeed-show-unique-buffers t
783 elfeed-db-directory (sync/ "elfeed/db/" t))
784 (:with-mode elfeed-show-mode
785 (:bind "SPC" '+elfeed-scroll-up-command
786 "S-SPC" '+elfeed-scroll-down-command)))
787
788(setup (:straight elfeed-org)
789 (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t)))
790 (elfeed-org))
791
792(setup (:straight (lin :host gitlab :repo "protesilaos/lin"))
793 (require 'lin)
794 (:hook-into dired-mode
795 elfeed-search-mode
796 git-rebase-mode
797 ibuffer-mode
798 ledger-report-mode
799 log-view-mode
800 magit-log-mode
801 notmuch-search-mode
802 notmuch-tree-mode
803 org-agenda-mode
804 tabulated-list-mode))
805
806
807(setup browse-url
808 (:also-load +browse-url)
809 (:option browse-url-secondary-browser-function (if (executable-find "firefox")
810 'browse-url-firefox
811 'browse-url-default-browser)
812 browse-url-new-window-flag nil
813 browse-url-firefox-arguments '("--new-tab")
814 browse-url-firefox-new-window-is-tab t)
815 ;; Set up URL handlers.
816 (+browse-url-set-handlers
817 (list
818 (cons (rx ; images
819 "." (or "jpeg" "jpg" "png") eos)
820 (lambda (&rest args)
821 (apply
822 (cond ((executable-find "feh") '+browse-url-with-feh)
823 ((executable-find "mpv") '+browse-image-with-mpv)
824 (t 'eww-browse-url))
825 args)))
826 (cons (rx ; videos
827 (or "youtube.com" "youtu.be" "yewtu.be"
828 (seq "." (or "mp4" "gif" "mov" "MOV") eos)))
829 (lambda (&rest args)
830 (apply (if (executable-find "mpv")
831 'browse-url-mpv
832 browse-url-secondary-browser-function)
833 args)))
834 (cons (rx ; non-eww-friendly websites
835 (or
836 "github.com"
837 "gitlab.com"
838 "google.com"
839 "imgur.com"
840 "pixelfed"
841 "reddit.com"
842 "taskiq"
843 "twitter.com"
844 ))
845 browse-url-secondary-browser-function)
846 (cons "." ; everything else
847 'eww-browse-url)))
848 ;; Transform URLs before passing to `browse-url'
849 (:option +browse-url-transformations `((,(rx "//" (or "youtube.com"
850 "youtu.be"))
851 . "//yewtu.be")))
852 (+browse-url-transform-url-global-mode +1))
853
854(setup (:straight-when pdf-tools
855 (eq system-type 'gnu/linux))
856 (pdf-tools-install))