From b7295426c95bf968288bb6ead2db416a71ec4d3e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 9 Jan 2022 20:52:07 -0600 Subject: Weekend, babee --- init.el | 138 ++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 46 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index b32dfce..1a39f3c 100644 --- a/init.el +++ b/init.el @@ -38,11 +38,12 @@ "C-x o" (lambda () (interactive) (switch-to-buffer nil)) "C-x C-o" #'+open-paragraph "C-w" #'+kill-word-backward-or-region - "C-x C-1" #'delete-other-windows - "C-x 2" #'+split-window-below-then - "C-x C-2" #'+split-window-below-then - "C-x 3" #'+split-window-right-then - "C-x C-3" #'+split-window-right-then) + ;; "C-x C-1" #'delete-other-windows + ;; "C-x 2" #'+split-window-below-then + ;; "C-x C-2" #'+split-window-below-then + ;; "C-x 3" #'+split-window-right-then + ;; "C-x C-3" #'+split-window-right-then + ) ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults (global-set-key (kbd "C-h") 'delete-backward-char) (keyboard-translate ?\C-h ?\C-?) @@ -58,9 +59,6 @@ (:bind "C-c s" #'+init-sort-then-save) (:hook #'+init-add-setup-to-imenu)) -(setup (:require +lookup) - (+lookup-mode +1)) - (setup (:require auth-source) (:option auth-sources (list (private/ "authinfo")))) @@ -109,6 +107,9 @@ (:option pulse-flag nil pulse-delay 0.5 pulse-iterations 1) + (dolist (command '(+ace-window-or-switch-buffer + pop-mark pop-globl-mark)) + (add-to-list '+pulse-location-commands command)) (+ensure-after-init #'+pulse-location-mode)) (setup (:require reading) @@ -137,6 +138,15 @@ (:option browse-url-browser-function #'eww-browse-url +browse-url-browser-function browse-url-browser-function + browse-url-generic-program (seq-some #'executable-find + '("firefox" + "chromium" + "chrome")) + browse-url-generic-args (seq-some (lambda (e) + (when (equal (executable-find (car e)) + browse-url-generic-program) + (cdr e))) + '(("firefox" "--new-tab"))) browse-url-secondary-browser-function (if (executable-find "firefox") #'browse-url-firefox #'browse-url-default-browser) @@ -230,7 +240,7 @@ copy move hardlink symlink shell touch) dired-dwim-target t) - (:local-set truncate-lines nil) + (:local-set truncate-lines t) (:bind "" #'dired-up-directory "TAB" #'dired-subtree-cycle "i" #'dired-subtree-toggle @@ -475,13 +485,19 @@ (with-eval-after-load 'org (org-clock-persistence-insinuate) (org-link-set-parameters "tel" :follow #'+org-tel-open)) - ;; Fancy list bullets + ;; Extra keywords (font-lock-add-keywords 'org-mode - '(("^ *\\([-]\\) " + '(;; Fancy list bullets + ("^ *\\([-]\\) " (0 (compose-region (match-beginning 1) (match-end 1) "•"))) ("^ *\\([+]\\) " - (0 (compose-region (match-beginning 1) (match-end 1) "◦")))))) + (0 (compose-region (match-beginning 1) (match-end 1) "◦")))) + (with-eval-after-load 'form-feed + ;; Horizontal lines + (font-lock-add-keywords + 'org-mode + '(("^-----+" 0 'form-feed--font-lock-face t)))))) (setup org-agenda (:option org-agenda-skip-deadline-if-done t @@ -586,9 +602,6 @@ (executable-find "diff")) (:require apheleia +apheleia) - (setf (alist-get 'indent-region apheleia-formatters) #'+apheleia-indent-region - (alist-get 'emacs-lisp-mode apheleia-mode-alist) 'indent-region - (alist-get 'lisp-interaction-mode apheleia-mode-alist) 'indent-region) (apheleia-global-mode +1)) (setup (:straight avy) @@ -721,9 +734,15 @@ (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer) (:with-mode circe-chat-mode + (:local-set lui-input-function #'+lui-filter) (:hook #'enable-circe-color-nicks #'enable-circe-new-day-notifier - #'+circe-chat@set-prompt) + #'+circe-chat@set-prompt + ;; Filters + #'+circe-F/C-mode + ;; For some reason `+circe-shorten-url-mode' won't work right out of + ;; the gate. + (lambda () (run-with-idle-timer 0.25 nil #'+circe-shorten-url-mode))) (:bind "C-c C-s" #'circe-command-SLAP)) (:with-mode lui-mode @@ -889,8 +908,7 @@ See also `crux-reopen-as-root-mode'." (:option dictionary-use-single-buffer t) (autoload 'dictionary-search "dictionary" "Ask for a word and search it in all dictionaries" t) - (:hook #'reading-mode) - (define-key +lookup-mode-map "d" #'dictionary-search)) + (:hook #'reading-mode)) (setup (:straight (discord :host github @@ -918,12 +936,15 @@ See also `crux-reopen-as-root-mode'." elfeed-search-title-min-width 24 elfeed-search-title-max-width 78 elfeed-show-unique-buffers t - elfeed-db-directory (elfeed/ "db/" t)) - (:+key "C-x w" #'+elfeed) + elfeed-db-directory (elfeed/ "db/" t) + elfeed-log 'debug ; until I can figure out syncing... + ) + (:+key "C-x w" #'elfeed) (:with-mode elfeed-search-mode (:hook #'hl-line-mode) ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ - (advice-add #'elfeed-search-update--force :after #'elfeed-db-save)) + (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) + (advice-add #'elfeed :before #'elfeed-db-load)) (:with-mode elfeed-show-mode (:bind "SPC" #'+elfeed-scroll-up-command "S-SPC" #'+elfeed-scroll-down-command) @@ -945,14 +966,16 @@ See also `crux-reopen-as-root-mode'." (setup (:straight elpher)) (setup (:straight embark) - (:also-load +embark) + (:require embark + +embark) (:option prefix-help-command 'embark-prefix-help-command embark-keymap-prompter-key ";") (:+key "C-." #'embark-act "M-." #'embark-dwim " B" #'embark-bindings) (:with-map minibuffer-local-map - (:bind "C-." #'embark-act)) + (:bind "C-." #'embark-act + "M-." #'embark-dwim)) (:with-map embark-file-map (:bind "l" #'vlf))) @@ -1059,14 +1082,14 @@ See also `crux-reopen-as-root-mode'." (:file-match (rx ".rkt" eos) (rx ".scm" eos))) -(setup (:straight god-mode) - (setq god-mode-enable-function-key-translation nil) - (:require god-mode - +god-mode) - (:+key "C-M-g" #'god-mode-all) - (:with-mode god-local-mode - (:bind "i" #'+god-mode-insert - "a" nil))) +;; (setup (:straight god-mode) +;; (setq god-mode-enable-function-key-translation nil) +;; (:require god-mode +;; +god-mode) +;; (:+key "C-M-g" #'god-mode-all) +;; (:with-mode god-local-mode +;; (:bind "i" #'+god-mode-insert +;; "a" nil))) (setup (:straight helpful) (run-with-idle-timer 0.5 nil @@ -1132,17 +1155,9 @@ See also `crux-reopen-as-root-mode'." (setup (:straight (lin :host gitlab :repo "protesilaos/lin")) (require 'lin) - (:hook-into dired-mode - elfeed-search-mode - git-rebase-mode - ibuffer-mode - ledger-report-mode - log-view-mode - magit-log-mode - notmuch-search-mode - notmuch-tree-mode - org-agenda-mode - tabulated-list-mode)) + (dolist (hook lin-foreign-hooks) + (add-hook hook #'hl-line-mode) + (add-hook hook #'lin-mode))) (setup (:straight link-hint) (:require +link-hint) @@ -1155,6 +1170,11 @@ See also `crux-reopen-as-root-mode'." "m" #'link-hint-open-multiple-links "M-c" #'link-hint-copy-link "c" #'link-hint-copy-link))) +(setup (:straight macrostep) + (:require macrostep) + (:with-mode emacs-lisp-mode + (:bind "C-c e" #'macrostep-expand))) + (setup (:straight marginalia) (marginalia-mode +1)) @@ -1306,8 +1326,10 @@ See also `crux-reopen-as-root-mode'." :host github :repo "duckwork/titlecase.el" :files ("*"))) - (:with-map +casing-mode-map - (:bind "t" #'titlecase-dwim))) + (:require titlecase) + (:with-map +casing-map + (:bind "t" #'titlecase-dwim + "M-t" #'titlecase-dwim))) (setup (:straight topsy) (:hook-into ;;prog-mode @@ -1366,11 +1388,35 @@ See also `crux-reopen-as-root-mode'." (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) (vertico-mode +1) ;; Extensions - (:also-load vertico-directory) + (:also-load vertico-directory + vertico-mouse + vertico-unobtrusive + vertico-multiform) + (vertico-mouse-mode +1) + (vertico-multiform-mode +1) + (:option vertico-multiform-commands '((execute-extended-command flat) + (helpful-callable) + (helpful-variable)) + ;; This is applied /after/ the above, so default is at the end of + ;; this alist. + vertico-multiform-categories '((file buffer grid) + (t unobtrusive))) + (dolist (buf-cmd '(consult-find + consult-locate + consult-grep + consult-git-grep + consult-ripgrep + consult-line + consult-line-multi + consult-multi-occur + consult-keep-lines + consult-focus-lines)) + (setf (alist-get buf-cmd vertico-multiform-commands) '(buffer))) (:with-map vertico-map (:bind "RET" #'vertico-directory-enter "DEL" #'vertico-directory-delete-char - "M-DEL" #'vertico-directory-delete-word)) + "M-DEL" #'vertico-directory-delete-word + "TAB" #'+vertico-widen-or-complete)) (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) (setup (:straight visual-fill-column) -- cgit 1.4.1-21-gabe81