This commit is contained in:
Case Duckworth 2022-06-15 10:26:10 -05:00
parent 21b5d80814
commit dbb6181a5d
5 changed files with 128 additions and 70 deletions

109
init.el
View File

@ -53,7 +53,10 @@
"C-<backspace>" #'+backward-kill-word "C-<backspace>" #'+backward-kill-word
"C-x TAB" #'+indent-rigidly "C-x TAB" #'+indent-rigidly
"<f7>" #'flyspell-mode "<f7>" #'flyspell-mode
"C-x C-c" #'+save-buffers-quit) "C-x C-c" #'+save-buffers-quit
"C-\\" nil ; original: toggle-input-method
"C-/" #'undo-only
"C-?" #'undo-redo)
;; Disable bindings ;; Disable bindings
(:global "M-j" nil (:global "M-j" nil
"<Scroll_Lock>" nil) "<Scroll_Lock>" nil)
@ -479,6 +482,9 @@
;; (+kmacro-recording-indicator-mode +1) ;; (+kmacro-recording-indicator-mode +1)
(+kmacro-block-undo-mode +1))) (+kmacro-block-undo-mode +1)))
(setup midnight
(midnight-mode +1))
(setup minibuffer (setup minibuffer
(:require +minibuffer) (:require +minibuffer)
(:with-map minibuffer-local-map (:with-map minibuffer-local-map
@ -898,6 +904,8 @@
(add-hook 'kill-buffer-query-functions #'+scratch-immortal)) (add-hook 'kill-buffer-query-functions #'+scratch-immortal))
(setup sh (setup sh
(:option sh-indentation tab-width)
(:hook #'indent-tabs-mode)
(:apheleia shfmt '("shfmt"))) (:apheleia shfmt '("shfmt")))
(setup shell (setup shell
@ -993,8 +1001,7 @@
(:face 'aw-mode-line-face '((t (:foreground "red")))) (:face 'aw-mode-line-face '((t (:foreground "red"))))
(+ace-window-display-mode +1)) (+ace-window-display-mode +1))
(setup (:straight (actually-selected-window (setup (:straight (actually-selected-window :host github
:host github
:repo "duckwork/actually-selected-window.el")) :repo "duckwork/actually-selected-window.el"))
(actually-selected-window-mode +1)) (actually-selected-window-mode +1))
@ -1121,8 +1128,7 @@
browse-kill-ring-separator " ") browse-kill-ring-separator " ")
(:hook #'form-feed-mode)) (:hook #'form-feed-mode))
(setup (:straight (cape (setup (:straight (cape :host github :repo "minad/cape"))
:host github :repo "minad/cape"))
(let (let
;; All available cape capfs listed here. Add them to the front since ;; All available cape capfs listed here. Add them to the front since
;; they're reversed with `add-to-list'. ;; they're reversed with `add-to-list'.
@ -1327,8 +1333,7 @@
(add-hook 'modus-themes-after-load-theme-hook #'circe-nick-color-reset)) (add-hook 'modus-themes-after-load-theme-hook #'circe-nick-color-reset))
(add-hook 'kill-emacs-hook #'+circe-quit-all@kill-emacs)) (add-hook 'kill-emacs-hook #'+circe-quit-all@kill-emacs))
(setup (:straight (clean-kill-ring (setup (:straight (clean-kill-ring :host github
:host github
:repo "NicholasBHubbard/clean-kill-ring.el")) :repo "NicholasBHubbard/clean-kill-ring.el"))
(:require) (:require)
(:option clean-kill-ring-prevent-duplicates t) (:option clean-kill-ring-prevent-duplicates t)
@ -1481,8 +1486,7 @@
"TAB" #'dired-subtree-cycle "TAB" #'dired-subtree-cycle
"i" #'dired-subtree-toggle)) "i" #'dired-subtree-toggle))
(setup (:straight (discord (setup (:straight (discord :host github
:host github
:repo "davep/discord.el" :repo "davep/discord.el"
:fork (:repo "duckwork/discord.el")))) :fork (:repo "duckwork/discord.el"))))
@ -1574,6 +1578,20 @@
(file+olp ,(car rmh-elfeed-org-files) "Feeds") (file+olp ,(car rmh-elfeed-org-files) "Feeds")
"* %? %^g"))) "* %? %^g")))
(setup (:straight (elfeed-tube :host github :repo "karthink/elfeed-tube")
(or (executable-find "youtube-dl")
(executable-find "yt-dlp")))
(:straight (elfeed-tube-mpv :host github :repo "karthink/elfeed-tube"))
(:load-after elfeed)
(with-eval-after-load 'elfeed
(elfeed-tube-setup)
(:bind-into (elfeed-show-mode-map elfeed-search-mode-map)
"F" #'elfeed-tube-fetch
[remap save-buffer] #'elfeed-tube-save)
(:bind-into elfeed-show-mode-map
"C-c C-f" #'elfeed-tube-mpv-follow-mode
"C-c C-w" #'elfeed-tube-mpv-where)))
(setup (:straight elpher) (setup (:straight elpher)
(:bind "l" #'elpher-back)) (:bind "l" #'elpher-back))
@ -1603,8 +1621,7 @@
:inherit font-lock-keyword-face)))) :inherit font-lock-keyword-face))))
(:+key "C-," #'embrace-commander)) (:+key "C-," #'embrace-commander))
(setup (:straight (ement (setup (:straight (ement :host github
:host github
:repo "alphapapa/ement.el") :repo "alphapapa/ement.el")
;; `plz' is a requirement, but isn't on an elpa. ;; `plz' is a requirement, but isn't on an elpa.
(setup (:straight (plz :host github (setup (:straight (plz :host github
@ -1661,19 +1678,11 @@
(:+key "C-=" #'er/expand-region (:+key "C-=" #'er/expand-region
"C--" #'+er/contract-or-negative-argument)) "C--" #'+er/contract-or-negative-argument))
(setup (:straight (fill-sentences-correctly (setup (:straight (filldent :host nil
:host github :repo "https://codeberg.org/acdw/filldent.el"))
:repo "duckwork/fill-sentences-correctly.el"))
(:quit "I don't think this works like how I want.")
(fill-sentences-correctly-mode +1))
(setup (:straight (filldent
:host github
:repo "duckwork/filldent.el"))
(:+key "M-q" #'filldent-unfill-toggle)) (:+key "M-q" #'filldent-unfill-toggle))
(setup (:straight (flymake-collection (setup (:straight (flymake-collection :host github
:host github
:repo "mohkale/flymake-collection")) :repo "mohkale/flymake-collection"))
(+ensure-after-init #'flymake-collection-hook-setup)) (+ensure-after-init #'flymake-collection-hook-setup))
@ -1702,8 +1711,7 @@
'notmuch-message) 'notmuch-message)
(:hook-into notmuch-show-mode)) (:hook-into notmuch-show-mode))
(setup (:straight (forge (setup (:straight (forge :host github :repo "magit/forge")
:host github :repo "magit/forge")
(eq system-type 'gnu/linux)) (eq system-type 'gnu/linux))
(:quit) ; XXX: Somehow missing compat-26 (:quit) ; XXX: Somehow missing compat-26
(add-to-list 'forge-alist (add-to-list 'forge-alist
@ -1715,9 +1723,8 @@
(:face 'form-feed-line '((t (:strike-through t)))) (:face 'form-feed-line '((t (:strike-through t))))
(global-form-feed-mode +1)) (global-form-feed-mode +1))
(setup (:straight (frowny (setup (:straight (frowny :host nil
:host github :repo "https://codeberg.org/acdw/frowny.el"))
:repo "duckwork/frowny.el"))
(:option frowny-eyes (rx (any ":=") (opt "'") (? "-"))) (:option frowny-eyes (rx (any ":=") (opt "'") (? "-")))
(global-frowny-mode +1)) (global-frowny-mode +1))
@ -1738,8 +1745,7 @@
(setf (alist-get "\\.scm\\'" auto-insert-alist nil nil #'equal) (setf (alist-get "\\.scm\\'" auto-insert-alist nil nil #'equal)
'(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n"))) '(insert "#!/bin/sh\n#| -*- scheme -*-\nexec csi -s $0 \"$@\"\n|#\n")))
(setup (:straight (git-modes (setup (:straight (git-modes :host github :repo "magit/git-modes"))
:host github :repo "magit/git-modes"))
(:require git-modes)) (:require git-modes))
(setup (:straight god-mode (setup (:straight god-mode
@ -1763,8 +1769,7 @@
(require 'info-look) (require 'info-look)
(info-lookup-setup-mode 'symbol 'emacs-lisp-mode)))) (info-lookup-setup-mode 'symbol 'emacs-lisp-mode))))
(setup (:straight (hippie-completing-read (setup (:straight (hippie-completing-read :host nil
:host nil
:repo "https://codeberg.org/acdw/hippie-completing-read.el")) :repo "https://codeberg.org/acdw/hippie-completing-read.el"))
(:+key "M-/" #'hippie-completing-read)) (:+key "M-/" #'hippie-completing-read))
@ -1825,8 +1830,8 @@
(define-key isearch-mb-minibuffer-map (kbd key) command))))))) (define-key isearch-mb-minibuffer-map (kbd key) command)))))))
(isearch-mb-mode +1)) (isearch-mb-mode +1))
(setup (:straight (jabber :repo "https://codeberg.org/emacs-jabber/emacs-jabber" (setup (:straight (jabber :host nil
:host nil :repo "https://codeberg.org/emacs-jabber/emacs-jabber"
:files ("*.el" "*.texi" :files ("*.el" "*.texi"
("jabber-fallback-lib" ("jabber-fallback-lib"
"jabber-fallback-lib/hexrgb.el" "jabber-fallback-lib/hexrgb.el"
@ -1896,8 +1901,8 @@
(remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo) (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo)
(remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo))
(setup (:straight (keepassxc-shim (setup (:straight (keepassxc-shim :host nil
:host github :repo "duckwork/keepassxc-shim.el")) :repo "https://codeberg.org/acdw/keepassxc-shim.el"))
(keepassxc-shim-activate)) (keepassxc-shim-activate))
(setup (:straight keychain-environment (setup (:straight keychain-environment
@ -1926,8 +1931,8 @@
"M-c" #'+link-hint-open-chrome "c" #'+link-hint-open-chrome))) "M-c" #'+link-hint-open-chrome "c" #'+link-hint-open-chrome)))
(setup (:straight (machine (setup (:straight (machine
:host github :host nil
:repo "duckwork/machine.el")) :repo "https://codeberg.org/acdw/machine.el"))
(+with-ensure-after-init ; So that they override anything here. (+with-ensure-after-init ; So that they override anything here.
;; Emoji fonts ;; Emoji fonts
(let ((ffl (font-family-list)) (let ((ffl (font-family-list))
@ -2008,7 +2013,10 @@
(:option modus-themes-mixed-fonts t (:option modus-themes-mixed-fonts t
modus-themes-bold-constructs t modus-themes-bold-constructs t
modus-themes-italic-constructs t modus-themes-italic-constructs t
modus-themes-headings '((t t))) modus-themes-headings '((1 monochrome bold overline)
(2 monochrome bold)
(3 monochrome italic)
(t monochrome)))
(dotimes (facen-1 8) (dotimes (facen-1 8)
(let ((facen (1+ facen-1))) (let ((facen (1+ facen-1)))
(custom-set-faces (custom-set-faces
@ -2178,8 +2186,8 @@
(local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize)))) (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize))))
(setup (:straight (org-taskwise (setup (:straight (org-taskwise
:host github :host nil
:repo "duckwork/org-taskwise.el")) :repo "https://codeberg.org/acdw/org-taskwise.el.git"))
(with-eval-after-load 'org (with-eval-after-load 'org
(require 'org-taskwise) (require 'org-taskwise)
(define-key org-mode-map (kbd "C-x n t") #'org-taskwise-narrow-to-task))) (define-key org-mode-map (kbd "C-x n t") #'org-taskwise-narrow-to-task)))
@ -2264,9 +2272,8 @@
persistent-scratch-scratch-buffer-p-function)) persistent-scratch-scratch-buffer-p-function))
(setup (:straight (plancat (setup (:straight (plancat
:host github :host nil
:repo "duckwork/plancat.el" :repo "https://codeberg.org/acdw/plancat.el"))
:local-repo "~/src/emacs-packages/plancat.el/"))
(:option plancat-user "acdw")) (:option plancat-user "acdw"))
(setup (:straight pocket-reader) (setup (:straight pocket-reader)
@ -2287,8 +2294,6 @@
(setup (:straight rainbow-mode) (setup (:straight rainbow-mode)
(:hook-into prog-mode)) (:hook-into prog-mode))
(setup (:straight restart-emacs))
(setup (:straight (shell-command+ (setup (:straight (shell-command+
:host nil :host nil
:repo "https://git.sr.ht/~pkal/shell-command-plus")) :repo "https://git.sr.ht/~pkal/shell-command-plus"))
@ -2375,8 +2380,8 @@
(:hook-into prog-mode)) (:hook-into prog-mode))
(setup (:straight (sophomore (setup (:straight (sophomore
:host github :host nil
:repo "duckwork/sophomore.el")) :repo "https://codeberg.org/acdw/sophomore.el"))
(sophomore-enable #'narrow-to-region) (sophomore-enable #'narrow-to-region)
(sophomore-disable ; These are mostly annoying commands (sophomore-disable ; These are mostly annoying commands
#'view-hello-file #'view-hello-file
@ -2389,8 +2394,8 @@
(sophomore-mode +1)) (sophomore-mode +1))
(setup (:straight (spongebob-case (setup (:straight (spongebob-case
:host github :host nil
:repo "duckwork/spongebob-case.el"))) :repo "https://codeberg.org/acdw/spongebob-case.el")))
(setup (:straight ssh-config-mode) (setup (:straight ssh-config-mode)
(:file-match (rx "/.ssh/config" eos) (:file-match (rx "/.ssh/config" eos)
@ -2414,8 +2419,8 @@
(:option systemd-man-function 'woman)) (:option systemd-man-function 'woman))
(setup (:straight (titlecase (setup (:straight (titlecase
:host github :host nil
:repo "duckwork/titlecase.el" :repo "https://codeberg.org/acdw/titlecase.el"
:files ("*"))) :files ("*")))
(:require titlecase +titlecase) (:require titlecase +titlecase)
(:with-map +casing-map (:with-map +casing-map
@ -2466,7 +2471,7 @@
(:option twtxt-file _twtxt-file (:option twtxt-file _twtxt-file
twtxt-following _twtxt-following)) twtxt-following _twtxt-following))
(setup (:straight undo-fu) (setup (:straight undo-fu) (:quit "Trying native undo functionality")
(:option undo-fu-allow-undo-in-region t) (:option undo-fu-allow-undo-in-region t)
(:global "C-/" #'undo-fu-only-undo (:global "C-/" #'undo-fu-only-undo
"C-?" #'undo-fu-only-redo)) "C-?" #'undo-fu-only-redo))

View File

@ -206,8 +206,17 @@ Do this only if the buffer is not visiting a file."
;;; Hooks ;;; Hooks
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p) (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
(add-hook 'minibuffer-setup-hook 'cursor-intangible-mode) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
(defun +auto-create-missing-dirs ()
"Automatically create missing directories when finding a file."
;; https://emacsredux.com/blog/2022/06/12/auto-create-missing-directories/
(let ((target-dir (file-name-directory buffer-file-name)))
(unless (file-exists-p target-dir)
(make-directory target-dir t))))
(add-hook 'find-file-not-found-functions #'+auto-create-missing-dirs)
;;; Better-default functions ... ;;; Better-default functions ...

View File

@ -729,5 +729,42 @@ When called with a prefix ARG, will still unconditionally call
((org-at-table-p) #'org-table-wrap-region) ((org-at-table-p) #'org-table-wrap-region)
(t #'org-return))))) (t #'org-return)))))
;;; el-patch
(el-patch-defun org-format-outline-path (path &optional width prefix separator)
"Format the outline path PATH for display.
WIDTH is the maximum number of characters that is available.
PREFIX is a prefix to be included in the returned string,
such as the file name.
SEPARATOR is inserted between the different parts of the path,
the default is \"/\"."
(setq width (or width 79))
(setq path (delq nil path))
(unless (> width 0)
(user-error "Argument `width' must be positive"))
(setq separator (or separator "/"))
(let* ((org-odd-levels-only nil)
(fpath (concat
prefix (and prefix path separator)
(mapconcat
(lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s))
(cl-loop for head in path
for n from 0
collect (el-patch-swap
(org-add-props
head nil 'face
(nth (% n org-n-level-faces) org-level-faces))
head))
separator))))
(when (> (length fpath) width)
(if (< width 7)
;; It's unlikely that `width' will be this small, but don't
;; waste characters by adding ".." if it is.
(setq fpath (substring fpath 0 width))
(setf (substring fpath (- width 2)) "..")))
fpath))
(provide '+org) (provide '+org)
;;; +org.el ends here ;;; +org.el ends here

View File

@ -4,10 +4,14 @@
;;; Code: ;;; Code:
(defun +titlecase-sentence-style-dwim () (defun +titlecase-sentence-style-dwim (&optional arg)
"Titlecase a sentence." "Titlecase a sentence.
(interactive) With prefix ARG, toggle the value of
(titlecase-dwim 'sentence)) `titlecase-downcase-sentences' before sentence-casing."
(interactive "P")
(let ((titlecase-downcase-sentences (if arg (not titlecase-downcase-sentences)
titlecase-downcase-sentences)))
(titlecase-dwim 'sentence)))
(defun +titlecase-org-headings () (defun +titlecase-org-headings ()
(interactive) (interactive)

View File

@ -8,33 +8,36 @@
(require 'machine) (require 'machine)
(defun +bob-set-faces (&rest _) (defun +bob-set-faces (&rest _)
(let ((base-face "IBM Plex Mono") (let (;;(base-face "IBM Plex Mono")
(base-size 110) (base-face "Iosevka Comfy Wide")
(base-size 100)
(italic-face nil) (italic-face nil)
;; (bold-face nil) ;; (bold-face nil)
(mono-face nil) (mono-face nil)
(var-face "IBM Plex Sans") ;; (var-face "IBM Plex Sans")
(var-face "Iosevka Comfy Duo")
(var-size 1.0)) (var-size 1.0))
(+set-faces (+set-faces
`((default `((default
:family ,base-face :family ,base-face
:height ,base-size :height ,base-size
:weight normal) :weight regular)
;; (bold :family ,(or bold-face base-face) (bold :family ,(or (bound-and-true-p bold-face) base-face)
;; :weight bold) :weight extra-bold)
(italic :family ,(or italic-face base-face) (italic :family ,(or (bound-and-true-p italic-face) base-face)
:weight normal :weight normal
:slant italic) :slant italic)
(fixed-pitch :family ,(or mono-face base-face) (fixed-pitch :family ,(or (bound-and-true-p mono-face) base-face)
:height 1.0) :height 1.0)
(variable-pitch (variable-pitch
:family ,(or var-face base-face) :family ,(or var-face base-face)
:height ,var-size) :height ,var-size)
(org-italic ;; (org-italic
:family ,(or var-face base-face) ;; :family ,(or var-face base-face)
:slant italic))))) ;; :slant italic)
))))
;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]] ;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]]
(add-function :after machine-after-load-theme #'+bob-set-faces) (add-hook 'machine-after-load-theme-hook #'+bob-set-faces)
;; bob.el ends here (+bob-set-faces) ;; bob.el ends here (+bob-set-faces)