init.el (14308B)
1 ;;; -*- lexical-binding: t; -*- 2 3 (setq gc-cons-threshold (* 1024 1024 1024)) 4 5 (setq read-process-output-max (string-to-number 6 (with-temp-buffer 7 (insert-file-contents "/proc/sys/fs/pipe-max-size") 8 (buffer-string)))) 9 10 (require 'server) 11 (unless (server-running-p) 12 (server-start)) 13 14 (require 'benchmark-init) 15 16 (add-to-list 'load-path (concat user-emacs-directory 17 "local-packages/emacs-kakafarm/")) 18 19 (load (locate-user-emacs-file "local-stuff.el")) 20 21 (setq package-archives '()) 22 (require 'use-package) 23 24 (setq major-mode-remap-alist '((emacs-lisp-mode . fundamental-mode))) 25 26 (autoload 'skribilo-mode "skribilo.el" "Skribilo mode." t) 27 28 '(progn 29 ;;; Weird https://www.youtube.com/watch?v=TjMTNSdhUvk stuff. 30 (setq inhibit-startup-message t) 31 (menu-bar-mode 1) 32 (fido-vertical-mode 1) 33 ;; (icomplete-vertical-mode 1) 34 (push 'flex completion-styles) 35 '(eldoc-mode 1) 36 (flymake-mode 1) 37 ;; (load-theme 'modus-vivendi-tinted t) 38 (setopt mode-line-end-spaces nil) 39 (set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?|)) 40 (xterm-mouse-mode 1)) 41 42 (use-package browse-url 43 :demand t 44 :custom 45 (browse-url-browser-function 'eww-browse-url) 46 (browse-url-new-window-flag t) 47 ) 48 49 (use-package casual-calc 50 :ensure nil 51 :bind (:map calc-mode-map ("C-o" . casual-calc-tmenu))) 52 53 (use-package casual-dired 54 :ensure nil 55 :bind (:map dired-mode-map ("C-o" . casual-dired-tmenu))) 56 57 (use-package casual-info 58 :ensure nil 59 :bind (:map Info-mode-map ("C-o" . casual-info-tmenu))) 60 61 '(use-package company 62 :defer t 63 :init 64 (add-hook 'after-init-hook 'global-company-mode)) 65 66 (use-package compilation 67 :demand t 68 :requires (ansi-color) 69 ) 70 71 ;; FIXME: Why can't I use it in the (use-package compilation :hook or :init)? 72 (add-hook 'compilation-filter-hook #'kakafarm/colorize-compilation) 73 74 75 (use-package corfu 76 :defer t 77 :config 78 (global-corfu-mode) 79 :custom 80 (corfu-auto t)) 81 82 (use-package cus-edit 83 :config 84 ;; Use another file for the ``customize'' customisations. 85 (setq custom-file (locate-user-emacs-file "custom-variables.el")) 86 (load custom-file 'noerror 'nomessage)) 87 88 (use-package detubifier 89 :defer t 90 ) 91 92 (use-package dictionary 93 :defer t 94 :custom 95 (dictionary-server "localhost")) 96 97 (use-package elfeed 98 :defer t 99 :config 100 ;; XXX: Not sure if I want it to be a `kakafarm/elfeed-feeds' 101 ;; variable that is then set to `elfeed-feeds' in the `:custom' 102 ;; section, or loaded inside the `elfeed-feeds.el' file using the 103 ;; `customize-set-value' function. 104 (load (locate-user-emacs-file "elfeed-feeds.el")) 105 (customize-set-value 'elfeed-curl-program-name 106 (expand-file-name "~/.guix-profile/bin/curl")) 107 :custom 108 ;; (elfeed-curl-max-connections 10) 109 (elfeed-search-filter "@1-week-ago +unread") 110 (elfeed-curl-program-name (expand-file-name "~/.guix-profile/bin/curl")) 111 ) 112 113 '(use-package elfeed-goodies 114 :config 115 (elfeed-goodies/setup)) 116 117 (use-package emacs 118 :ensure nil 119 :bind 120 ( 121 :map global-map 122 ("C-c p p" . kakafarm/percent-read) 123 ("C-c C-s" . (lambda (beg end) 124 (interactive (list (region-beginning) (region-end))) 125 126 (sort-lines '() 127 beg 128 end))) 129 130 ;; (";" . #'kakafarm/easy-underscore) 131 ) 132 :config 133 (set-register ?i `(file . ,(locate-user-emacs-file "init.el"))) 134 '(ido-mode t) 135 ;; (tab-bar-mode) 136 :custom 137 (inhibit-startup-screen t) 138 ) 139 140 (use-package ement 141 :custom 142 (ement-auto-sync nil) 143 (ement-save-sessions t) 144 ) 145 146 (use-package erc 147 :defer t 148 :custom 149 (erc-server "irc.libera.chat") 150 (erc-nick "kakafarm") 151 (erc-track-shorten-start 8) 152 (erc-kill-buffer-on-part t) 153 (erc-auto-query 'bury) 154 (erc-autojoin-channels-alist '((libera-kakafarm "#systemcrafters"))) 155 :bind 156 (("C-c i r c" . (lambda () 157 (interactive) 158 (erc-tls :id 'libera-kakafarm)))) 159 ;; :config 160 ;; (erc-tls :id 'libera-kakafarm) 161 ) 162 163 (use-package ffap 164 :defer t 165 :bind 166 ( 167 ("C-c f a p" . ffap-menu) 168 ("C-c f f a p" . kakafarm/ffap-browse-urls) 169 )) 170 171 (use-package fontset 172 :defer t 173 :config 174 (set-fontset-font t 'hebrew "Noto Sans Hebrew")) 175 176 (use-package geiser 177 :defer t 178 :after (scheme-mode) 179 :config 180 '((define-key 'geiser-mode-map) 181 (setq geiser-active-implementations '(guile)) 182 (global-unset-key "C-c C-a") 183 (unbind-key "C-c C-e" geiser-mode-map) 184 (unbind-key "C-c C-a" geiser-mode-map)) 185 :custom 186 (geiser-default-implementation 'guile) 187 (geiser-mode-auto-p nil) 188 (geiser-repl-per-project-p t) 189 ) 190 191 (use-package greader 192 :defer t 193 :commands (greader-mode) 194 :config 195 (add-hook 'greader-mode-hook 196 'kakafarm/sentence-end-double-nilify-for-read-only-buffers) 197 :hook ( 198 Custom-mode 199 Info-mode 200 Man-mode 201 elfeed-show 202 elfeed-show-mode 203 elpher 204 eww-after-render 205 fundamental-mode 206 help-mode 207 helpful-mode 208 lisp-mode 209 nov-mode 210 text-mode 211 w3m-mode 212 )) 213 214 (use-package helm 215 :defer t 216 :bind 217 ( 218 :map global-map 219 ("M-x" . helm-M-x) 220 ) 221 ) 222 223 (use-package helpful 224 :defer t 225 :bind 226 ( 227 ("C-h f" . helpful-function) 228 ("C-h k" . helpful-key) 229 ("C-h m" . helpful-mode) 230 ("C-h v" . helpful-variable) 231 ) 232 ) 233 234 (use-package icomplete 235 :defer t 236 :config 237 ;; Display completions continuously in minibuffer. 238 (icomplete-mode 1)) 239 240 (use-package info 241 :defer t 242 :custom 243 (Info-additional-directory-list '("~/infopath/"))) 244 245 (use-package kakafarm 246 :demand t 247 :bind 248 ( 249 :map global-map 250 ("C-c C-w" . kakafarm/multi-vterm-weechat) 251 ("C-c w" . kakafarm/multi-vterm-weechat) 252 ) 253 ) 254 255 (use-package magit 256 :custom 257 (magit-diff-refine-hunk t) 258 (magit-diff-refine-ignore-whitespace nil) 259 ) 260 261 (use-package magit-todos 262 :defer t 263 :after magit 264 :config 265 (magit-todos-mode 1) 266 :custom 267 (magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'") 268 ) 269 270 (use-package mastodon 271 :defer t 272 :init 273 ;; (setq mastodon-active-user "kakafarm" 274 ;; mastodon-instance-url "https://emacs.ch/") 275 (setq mastodon-active-user "kakafarm" 276 mastodon-instance-url "https://shitposter.world/") 277 ) 278 279 (use-package menu-bar 280 :custom 281 (menu-bar-mode nil) 282 ) 283 284 '(use-package mode-line 285 :custom 286 (mode-line-percent-position '(6 "%q")) 287 ) 288 289 (use-package modus-themes 290 :defer t 291 :init 292 (setq modus-themes-mode-line '(borderless 293 accented 294 ;; 3d 295 padded 296 ;; moody 297 ) 298 modus-themes-region '(;;accented 299 bg-only 300 ;;no-extend 301 ) 302 modus-themes-paren-match '(bold 303 intense) 304 ;;modus-themes-syntax '(alt-syntax) 305 modus-themes-scale-headings t 306 modus-themes-org-blocks 'tinted-background) 307 (load-theme 'modus-vivendi) 308 ;;(load-theme 'wheatgrass) 309 ) 310 311 (use-package mule 312 :defer t 313 :config 314 ;;; https://emacs.stackexchange.com/questions/34322/set-default-coding-system-utf-8 315 (set-language-environment "utf-8")) 316 317 (use-package multi-vterm 318 ;; :demand t 319 :bind 320 ( 321 :map global-map 322 ("C-c <RET> <RET>" . multi-vterm) 323 ("C-c m m" . multi-vterm) 324 :map vterm-mode-map 325 ("C-q" . vterm-send-next-key) 326 ) 327 :commands 328 ( 329 multi-vterm 330 multi-vterm-buffer-exist-p 331 ) 332 ) 333 334 '(use-package nano-tts 335 :defer t 336 :hook (eww-after-render nov-mode Info-mode) 337 :custom 338 (nano-tts-words-per-minute 225) 339 ) 340 341 (use-package nov 342 :defer t 343 :mode ((rx ".epub" string-end) . nov-mode)) 344 345 (use-package fundamental 346 :mode ((rx ".el" string-end) . fundamental-mode)) 347 348 '(use-package opml-to-elfeed-feeds 349 :custom 350 (opml-to-elfeed-feeds-elfeed-feeds nil t) 351 ) 352 353 (use-package orderless 354 :defer t 355 :custom 356 (completion-styles 357 '(orderless 358 basic)) 359 (completion-category-overrides 360 '((file (styles 361 basic 362 partial-completion))))) 363 364 (use-package org 365 :defer t 366 :config 367 (org-babel-do-load-languages 368 'org-babel-load-languages 369 '( 370 (emacs-lisp . t) 371 (scheme . t) 372 (shell . t) 373 )) 374 :custom 375 (org-agenda-files (list (expand-file-name "~/mine/org/") 376 (expand-file-name "~/Documents/notes/"))) 377 (org-default-notes-file (expand-file-name "~/mine/org/org.org")) 378 (org-directory (expand-file-name "~/mine/org/")) 379 (org-export-use-babel nil) 380 (org-html-postamble t) 381 (org-html-postamble-format '(("en" "<p class=\"author\">Author: %a</p>\12<p class=\"date\">Date: %d</p>\12<p class=\"creator\">%c</p>\12<p class=\"validation\">%v</p>"))) 382 (org-structure-template-alist '( 383 ("a" . "export ascii") 384 ("c" . "center") 385 ("C" . "comment") 386 ("e" . "example") 387 ("E" . "export") 388 ("h" . "export html") 389 ("l" . "export latex") 390 ("q" . "quote") 391 ("s" . "src") 392 ("v" . "verse") 393 ("g" . "src scheme :session moo :results output :tangle eopl3.scm") 394 ("z" . "src scheme") 395 )) 396 ) 397 398 (use-package org-roam 399 :defer t 400 :bind (("C-c n l" . org-roam-buffer-toggle) 401 ("C-c n f" . org-roam-node-find) 402 ("C-c n i" . org-roam-node-insert)) 403 :config 404 ;;(org-roam-db-autosync-enable) 405 ;;(org-roam-db-autosync-mode) 406 :custom 407 (org-roam-directory "~/mine/roam/") 408 (org-roam-graph-viewer '(lambda (x) nil)) 409 ) 410 411 (use-package paredit 412 :defer t 413 :hook (emacs-lisp-mode 414 lisp-mode 415 scheme-mode)) 416 417 (use-package paren 418 :defer t 419 :config 420 (show-paren-mode)) 421 422 ;; XXX: Disabled. 423 '(use-package parinfer 424 :defer t 425 :hook (emacs-lisp-mode 426 lisp-mode 427 scheme-mode)) 428 429 (use-package rainbow-delimiters 430 :defer t 431 :config 432 (rainbow-delimiters-mode)) 433 434 (use-package recentf 435 :defer t 436 :config 437 (recentf-mode 1) 438 :bind (("C-S-t" . recentf-open-files) 439 ("C-c t" . recentf-open-files) 440 ("C-c l" . dictionary-lookup-definition)) 441 :custom 442 (recentf-max-menu-items 100) 443 (recentf-max-saved-items 100) 444 ) 445 446 (use-package scheme-mode 447 :defer t 448 :config 449 ;; TODO: Did it even work?! 450 (add-hook 'scheme-mode-hook 'hs-minor-mode) 451 (progn ;; For SRFI-253: 452 (put 'define-checked 'scheme-indent-function 1) 453 (put 'lambda-checked 'scheme-indent-function 1)) 454 :mode (rx "." (| "scm" "sxml" "skb") string-end) 455 ;; :bind (:map scheme-mode-map 456 ;; ("C-c C-e" . arei-mode-map) 457 ;; ("C-c C-a" . arei)) 458 ) 459 460 (use-package shr 461 :custom 462 (shr-width 75) 463 (shr-use-fonts nil) 464 (shr-use-colors nil) 465 (shr-indentation 2) 466 ) 467 468 (use-package simple 469 :defer 470 :init 471 (advice-add 'kill-ring-save 472 :before 473 'kakafarm/pulse-current-region) 474 :config 475 (column-number-mode) 476 ;; Don't want tabs in any of my source files. 477 (setq-default indent-tabs-mode 478 nil) 479 '(advice-add 'scratch-buffer 480 :after 481 (lambda () "Switch to text-mode." 482 (text-mode))) 483 :custom 484 (global-visual-line-mode t) 485 ) 486 487 (use-package undo-tree 488 :defer t 489 :config 490 (global-undo-tree-mode 1) 491 (setq undo-tree-auto-save-history nil) 492 :bind 493 ("C-x u" . undo-tree-visualize)) 494 495 (use-package vterm 496 :custom 497 (vterm-environment '("LC_ALL=en_IL.utf8")) 498 ) 499 500 '(use-package whitespace-cleanup 501 :custom 502 (global-whitespace-cleanup-mode t) 503 ) 504 505 (use-package window 506 :defer t 507 :config 508 '(advice-add 'recenter-top-bottom 509 :around 510 'kakafarm/recenter-top-bottom)) 511 512 (progn 513 ;;; Emacs From Scratch 514 ;;; https://systemcrafters.net/emacs-from-scratch/ 515 ;;; https://www.youtube.com/playlist?list=PLEoMzSkcN8oPH1au7H6B7bBJ4ZO7BXjSZ 516 517 (setq visible-cursor t 518 visible-bell t) 519 520 ;;; The Basics of Emacs Configuration 521 ;;; https://systemcrafters.net/emacs-from-scratch/basics-of-emacs-configuration/ 522 ;;; https://www.youtube.com/watch?v=OaF-N-FuGtc 523 524 (tool-bar-mode -1) 525 (scroll-bar-mode -1) 526 (menu-bar-mode -1) 527 ;; (global-display-line-numbers-mode 1) 528 (hl-line-mode 1) 529 (blink-cursor-mode 1) 530 531 ;;; https://systemcrafters.net/emacs-from-scratch/the-best-default-settings/ 532 ;;; https://www.youtube.com/watch?v=51eSeqcaikM 533 ;;(recentf-mode 1) 534 (setq history-length 25) 535 (savehist-mode 1) 536 (save-place-mode 1)) 537 538 (progn 539 ;;; Load org-roam stuff. 540 541 (defvar kakafarm/org-roam-my-publish-time 0 542 ;; TODO: Write docstring. 543 "TODO" 544 ) 545 546 (setq org-publish-project-alist 547 `(("roam" 548 :base-directory "~/mine/roam/publish/" 549 :auto-sitemap t 550 :sitemap-function kakafarm/org-roam-sitemap 551 :sitemap-title "Roam Notes" 552 :publishing-function kakafarm/org-roam-publication-wrapper 553 :publishing-directory "~/mine/roam-export" 554 :section-number nil 555 :table-of-contents nil 556 :include ,(directory-files "~/mine/roam/publish/" t ".*.org$") 557 :html-head "<link rel=\"stylesheet\" href=\"/index.css\" type=\"text/css\">"))) 558 559 (setq org-roam-graph-link-builder 560 'kakafarm/org-roam-custom-link-builder) 561 562 (add-hook 'org-roam-graph-generation-hook 563 (lambda (dot svg) 564 (if (< (- (cadr (current-time)) 565 kakafarm/org-roam-project-publish-time) 566 5) 567 (progn 568 (copy-file svg 569 "~/mine/roam-export/sitemap.svg" 570 't) 571 (setq kakafarm/org-roam-project-publish-time 572 0)))))) 573 574 (setq gc-cons-threshold (* 200 1024 1024)) 575 (put 'narrow-to-region 'disabled nil) 576 (put 'upcase-region 'disabled nil) 577 (put 'narrow-to-page 'disabled nil) 578 (put 'scroll-left 'disabled nil)