;; Welcome to the gay fucking emacs
;;@@@@@@@@@@@@@@@@@@@@.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.@@@@@
;;@@@@@@@@@@@@@@@@@........@@@........%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%.........
;;@@@@@@@@@@@@@@....*....................@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(...........
;;@@/.. @@@@@@...@@@@///.....///////........@@@@@@@@@@@@@@@@@@@@@@@@@//.@@@@///...
;;@/...........@@@@@@@@///.@@@@@@@@///,.......@@@@@@@@@.@@@@@@@@@@%.@/.@@@@@@//...
;;@//.......@@@@@@@@@@@.@@@@@@@@@@@@@@///........,@,...@@@.@@@@@@..@@@@@@@@@@@/...
;;@@@////@@@@@@@@@@@@.@@@@@@@@@@@@@@@@@@///..........@@@/........@@@@@@@@@@@@@/...
;;@@@@@@@@@@@@@@@@@..@@@@@@@@@@@@@@../@@@@@////.../@@@@/.......@@@@@@@@@@@@@@//..@
;;@@@@@@@@@@@@@@@/.@@@@@@@@@@@@.@/.....@@@@@@@@@@@@@@@@/////@@@@@@@@@@@@@@@@@/..@@
;;@@@@@@@@@@@@@/.@@@@@@@@@@@..@&//......@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/,.@@@
;;@@@@@@@@@@@@/.@@@@@@@@@...@@@@@&//....@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/..@@@
;;@@@@@@@@@@/....@@@@....@@@@@@@@@@//...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/..@@@@
;;@@@@@@@@@//.........@@@@@@@@@@@@@@/...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/..@@@@@
;;@@@@@@@@@///..../@@@@@@@@@@@@@@@@@/..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(/.@@@@@@
;;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;;@@@@@@@@@@@@@@@@/..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;;
;; sba emacs config
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-names-vector
["#ebdbb2" "#9d0006" "#98971a" "#b57614" "#076678" "#d3869b" "#689d6a" "#3c3836"])
'(byte-compile-verbose nil)
'(company-clang-executable nil)
'(compilation-message-face 'default)
'(cua-global-mark-cursor-color "#2aa198")
'(cua-normal-cursor-color "#839496")
'(cua-overwrite-cursor-color "#b58900")
'(cua-read-only-cursor-color "#859900")
'(custom-enabled-themes '(misterioso))
'(custom-raised-buttons nil)
'(custom-safe-themes
'("8450a92571b29a2184f7ad9be0760633245f95681c536c76dc740456ff904e38" "8d39fafad298d28a8f7ccc97c5951c7dab88d1acedf5470644214a02e13ddee7" "285d1bf306091644fb49993341e0ad8bafe57130d9981b680c1dbd974475c5c7" "7f1d414afda803f3244c6fb4c2c64bea44dac040ed3731ec9d75275b9e831fe5" "fee7287586b17efbfda432f05539b58e86e059e78006ce9237b8732fde991b4c" "524fa911b70d6b94d71585c9f0c5966fe85fb3a9ddd635362bfabd1a7981a307" default))
'(fci-rule-color "#073642")
'(git-gutter:added-sign "⨁")
'(git-gutter:deleted-sign "◌")
'(git-gutter:modified-sign "◰")
'(git-gutter:window-width 2)
'(global-company-mode t)
'(global-flycheck-mode t)
'(highlight-changes-colors '("#d33682" "#6c71c4"))
'(highlight-symbol-colors
'("#3b2b40b432a2" "#07ab45f74cea" "#475833eb3555" "#1d633c04567f" "#2d5443d9332c" "#436f35f83167" "#0613413f597e"))
'(highlight-symbol-foreground-color "#93a1a1")
'(highlight-tail-colors
'(("#073642" . 0)
("#5b7300" . 20)
("#007d76" . 30)
("#0061a8" . 50)
("#866300" . 60)
("#992700" . 70)
("#a00559" . 85)
("#073642" . 100)))
'(hl-bg-colors
'("#866300" "#992700" "#a7020a" "#a00559" "#243e9b" "#0061a8" "#007d76" "#5b7300"))
'(hl-fg-colors
'("#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36" "#002b36"))
'(hl-paren-colors '("#2aa198" "#b58900" "#268bd2" "#6c71c4" "#859900"))
'(ispell-dictionary nil)
'(keyboard-coding-system 'utf-8-unix)
'(lsp-ui-doc-border "#93a1a1")
'(mc/always-run-for-all t)
'(menu-bar-mode nil)
'(nrepl-message-colors
'("#dc322f" "#cb4b16" "#b58900" "#5b7300" "#b3c34d" "#0061a8" "#2aa198" "#d33682" "#6c71c4"))
'(org-capture-templates
'(("j" "general diary entry" entry
(file "~/org/diary.org")
"* %?\12")
("d" "debugging/dev entry" entry
(file "~/org/dev_n_debug_diary.org")
"* %?\12")
("s" "Slipbox" entry
(file "~/org/zettle_inbox.org")
"* %?\12")
("t" "Todo [inbox]" entry
(file+headline "~/org/inbox.org" "Tasks")
"* TODO %i%?\12")
("T" "Tickler" entry
(file+headline "~/org/tickler.org" "Tickler")
"* %i%?\12 %U")
("i" "idea" entry
(file "~/org/idea_inbox.org")
"* IDEA %i%? ")
("?" "question" entry
(file+headline "~/org/questions.org" "Questions")
"* QUESTION %i%?\12")
("w" "word capture" entry
(file "~/org/words.org")
"* %?\12 \12The definition?\12** Definition")
("n" "3fn capture" entry
(file "~/org/funeral_flowers_stage_script.org")
"* %?\12")
("k" "knowledge capture" entry
(file "~/org/knowledge.org")
"* %?\12")
("g" "capture unknown (gaps)" entry
(file "~/org/gaps.org")
"* %?\12")))
'(org-startup-truncated nil)
'(package-enable-at-startup nil)
'(package-selected-packages '(dash-functional obsidian python-black matlab-mode magit))
'(pos-tip-background-color "#073642")
'(pos-tip-foreground-color "#93a1a1")
'(ps-default-bg '(1.0 0.0 0.0))
'(ps-default-fg '(1.0 0.0 0.0))
'(scroll-bar-mode nil)
'(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#073642" 0.2))
'(straight-package-neutering-mode t)
'(straight-use-package-by-default t)
'(straight-use-package-mode t)
'(term-default-bg-color "#002b36")
'(term-default-fg-color "#839496")
'(tool-bar-mode nil)
'(url-cookie-file "/home/bgeast/.emacs.d/url/cookies")
'(vc-annotate-background nil)
'(vc-annotate-background-mode nil)
'(vc-annotate-color-map
'((20 . "#dc322f")
(40 . "#ca7966842090")
(60 . "#c05678c91534")
(80 . "#b58900")
(100 . "#a6088eed0000")
(120 . "#9e3a91a70000")
(140 . "#9629943b0000")
(160 . "#8dc696ae0000")
(180 . "#859900")
(200 . "#76f09b6145e9")
(220 . "#6cd69caa5b9d")
(240 . "#5f5f9e06701f")
(260 . "#4c1b9f788425")
(280 . "#2aa198")
(300 . "#3003984faf4d")
(320 . "#2f7093e9bae0")
(340 . "#2c5a8f79c670")
(360 . "#268bd2")))
'(vc-annotate-very-old-color nil)
'(weechat-color-list
'(unspecified "#002b36" "#073642" "#a7020a" "#dc322f" "#5b7300" "#859900" "#866300" "#b58900" "#0061a8" "#268bd2" "#a00559" "#d33682" "#007d76" "#2aa198" "#839496" "#657b83"))
'(woman-locale "en_US.UTF-8")
'(xterm-color-names
["#073642" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#eee8d5"])
'(xterm-color-names-bright
["#002b36" "#cb4b16" "#586e75" "#657b83" "#839496" "#6c71c4" "#93a1a1" "#fdf6e3"]))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :extend nil :stipple nil :background "#2d3743" :foreground "#f0f0f0" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 158 :width normal :foundry "PfEd" :family "DejaVu Sans Mono"))))
'(ansi-color-black ((t (:background "chartreuse" :foreground "chartreuse"))))
'(c-annotation-face ((t (:inherit font-lock-constant-face :background "red"))))
'(org-level-1 ((t (:extend nil :foreground "#fdaa3a" :weight bold :width normal))))
'(org-level-2 ((t (:extend nil :foreground "#64bfd6" :weight bold))))
'(org-level-3 ((t (:inherit outline-3 :extend nil :foreground "red"))))
'(org-level-4 ((t (:inherit outline-4 :extend nil :foreground "magenta"))))
'(org-level-5 ((t (:inherit outline-5 :extend nil :foreground "pink"))))
'(org-level-6 ((t (:inherit outline-6 :extend nil))))
'(org-level-7 ((t (:extend nil :foreground "#40ff00"))))
'(org-level-8 ((t (:inherit outline-8 :extend nil))))
'(org-tag ((t (:weight bold :height 0.5))))
'(rainbow-delimiters-depth-1-face ((t (:inherit rainbow-delimiters-base-face :foreground "snow"))))
'(rainbow-delimiters-depth-2-face ((t (:inherit rainbow-delimiters-base-face :foreground "purple1"))))
'(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "deep sky blue"))))
'(rainbow-delimiters-depth-4-face ((t (:inherit rainbow-delimiters-base-face :foreground "sea green"))))
'(rainbow-delimiters-depth-5-face ((t (:inherit rainbow-delimiters-base-face :foreground "chartreuse"))))
'(rainbow-delimiters-depth-6-face ((t (:inherit rainbow-delimiters-base-face :foreground "gold"))))
'(rainbow-delimiters-depth-7-face ((t (:inherit rainbow-delimiters-base-face :foreground "salmon"))))
'(rainbow-delimiters-depth-8-face ((t (:inherit rainbow-delimiters-base-face :foreground "DeepPink2"))))
'(rainbow-delimiters-depth-9-face ((t (:inherit rainbow-delimiters-base-face :foreground "magenta"))))
'(scroll-bar ((nil nil))))
(setq-default tab-width 4)
(setq default-tab-width 4)
(setq c-default-style "stroustrup")
;(if (not (display-graphic-p))
; (load-theme 'manoj-dark t)) ;; interminalnoonecanheartheblueexroil
(display-graphic-p)
;; Bootstrap straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Use straight.el for package installation
(setq straight-use-package-by-default t)
;; Integrate straight.el with use-package
(straight-use-package 'use-package)
(straight-use-package 'hy-mode)
(straight-use-package 'define-word) ;; dict
(straight-use-package 'synosaurus) ;; thesaurus
(straight-use-package 'rust-mode) ;; rust
;;(with-eval-after-load 'magit
;; (straight-use-package 'forge))
;;(with-eval-after-load 'forge
;; (straight-use-package 'ghub))
(setq auth-sources '("~/.authinfo"))
(straight-use-package 'magit)
(require 'magit)
;; Once .auth is sorted out uncomment vvvvvvvv
;; ----------------------------------------------
;; Once .auth is sorted out on the local machine
;; vvvvvvvv uncomment this block vvvvvvvv
;; ----------------------------------------------
;;(straight-use-package 'forge)
;;(require 'forge)
;;
;;(straight-use-package 'ghub)
;;(require 'ghub)
;;
;;(ghub-request "GET" "/user" nil
;; :forge 'github
;; :host "api.github.com"
;; :username "USERNAME"
;; :auth 'forge)
;;
;;(ghub-request "GET" "/user")
;; ----------------------------------------------
(straight-use-package 'rainbow-delimiters)
(rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(straight-use-package 'csharp-mode)
;;(straight-use-package 'bart-mode)
;;(require 'bart-mode)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Test menagerie START
;;; AUTO COMPLETION SAMPLE TESTING!!!!
;;;; ido option
;;(setq ido-enable-flex-matching t)
;;(setq ido-everywhere t)
;;(ido-mode 1)
;;(straight-use-package 'helm)
;;(helm-mode 1)
;; company
;;(straight-use-package 'company)
;;(add-hook 'after-init-hook 'global-company-mode)
;; syntax checking etc.
;;(straight-use-package 'flycheck)
;;(global-flycheck-mode)
;; redis client
;;(straight-use-package 'eredis)
;; whimsy
(straight-use-package 'yaml-mode)
;; org-roam
(straight-use-package 'org)
(require 'org)
(straight-use-package 'org-roam)
(require 'org-roam)
;;; Test menagerie END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;(global-set-key (kbd "C-; C-r")'org-roam-node-from-cite)
(global-set-key (kbd "C-c c") 'org-capture) ;; technically not org-roam but w/e
;;(global-set-key (kbd "C-; C-r") 'org-roam-node-insert)
;; Different emacs package servers
(require 'package)
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(setq package-enable-at-startup nil)
;;(global-set-key (kbd "C-; c") 'copilot-clear-overlay)
;; Magic is the word.
(global-set-key (kbd "M-o") 'synosaurus-lookup)
(global-set-key (kbd "M-p") 'define-word)
;;(define-key org-mode-map (kbd "C-S- i") nil)
(define-key org-mode-map (kbd "C-S-") nil)
(define-key org-mode-map (kbd "C-S-") 'org-insert-subheading)
(define-key org-mode-map (kbd "C-c C-l") nil)
(define-key org-mode-map (kbd "C-c C-i") nil)
(define-key org-mode-map (kbd "C-c C-l") 'org-store-link)
(define-key org-mode-map (kbd "C-c C-i") 'org-insert-link)
;;(global-set-key (kbd "C-S- i") 'org-insert-subheading)
;;(setq synosaurus-backend-wordnet t)
;;(global-set-key (kbd "C-, C-l") 'org-roam-node-insert)
(straight-use-package 'browse-kill-ring)
;;(straight-use-package 'org-mode-map)
(straight-use-package 'git-gutter)
(global-set-key (kbd "C-x x") 'git-gutter-mode)
;; multiple-cursors
(straight-use-package 'multiple-cursors)
(global-set-key (kbd "C-c m") 'mc/edit-lines)
;; godot config
(straight-use-package 'gdscript-mode)
(setq gdscript-use-tab-indents nil) ;; If true, use tabs for indents. +so lets make for fucks sure this is nil
;;(setq gdscript-godot-executable "/snap/bin/godot4") ;; Use this executable instead of 'godot' to open the Godot editor.
(setq gdscript-gdformat-save-and-format t) ;; Save all buffers and format them with gdformat anytime Godot executable is run.
;; dap-mode baybeeeee
(straight-use-package 'dap-mode)
;; Latex exporting
(require 'ox-latex)
(unless (boundp 'org-latex-classes)
(setq org-latex-classes nil))
(add-to-list 'org-latex-classes
'("article"
"\\documentclass{article}"
("\\section{%s}" . "\\section*{%s}")))
;; TODO make this into the podcast thing literate programming that would be neat for a .emacs file.
(put 'upcase-region 'disabled nil)
;; hide toolbar, menubar, scrollbar
(menu-bar-showhide-tool-bar-menu-customize-disable)
(toggle-scroll-bar -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(put 'scroll-left 'disabled nil)
(put 'scroll-right 'disabled nil)
(global-set-key (kbd "C-s-") 'shrink-window-horizontally)
(global-set-key (kbd "C-s-") 'enlarge-window-horizontally)
(global-set-key (kbd "C-s-") 'shrink-window)
(global-set-key (kbd "C-s-") 'enlarge-window)
;;(global-set-key (kbd "C-x t t") 'org-time-stamp)
(global-set-key (kbd "C-c t") 'org-time-stamp)
(global-set-key (kbd "C-c T") 'org-)
;; org-roam graph configurations
;;(add-to-list 'org-roam-graph-edge-extra-config '("dir" . "back"))
;; the latex toggle thing (commented out until melpa issue is fixed)
;; (add-hook 'org-mode-hook 'org-fragtog-mode)
;; sbcl common lisp slim set up
;;(load (expand-file-name "~/.quicklisp/slime-helper.el"))
;;(setq inferior-lisp-program "sbcl")
;;(put 'downcase-region 'disabled nil)
;; yoinked from jethrokuan
;;(setq org-roam-capture-templates
;; '(("m" "main" plain
;; "%?"
;; :if-new (file+head "main/${slug}.org"
;; "#+title: ${title}\n")
;; :immediate-finish t
;; :unnarrowed t)
;; ("r" "reference" plain "%?"
;; :if-new
;; (file+head "reference/${title}.org" "#+title: ${title}\n")
;; :immediate-finish t
;; :unnarrowed t)))
;;(cl-defmethod org-roam-node-type ((node org-roam-node))
;; "Return the TYPE of NODE."
;; (condition-case nil
;; (file-name-nondirectory
;; (directory-file-name
;; (file-name-directory
;; (file-relative-name (org-roam-node-file node) org-roam-directory))))
;; (error "")))
;;(setq org-roam-node-display-template
;; (concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
;;(setq org-capture-templates
;; ;; other capture templates
;; '(("s" "Slipbox" entry (file "~/zorg-roam/inbox.org")
;;"* %?\n")
;; ("t" "Todo [inbox]" entry
;;(file+headline "~/inbox.org" "Tasks")
;; "* TODO %i%?")
;; ("T" "Tickler" entry
;; (file+headline "~/tickler.org" "Tickler")
;; "* %i%? \n %U")
;; ("?" "question" entry
;; (file+headline "~/questions.org" "Questions")
;; "* QUESTION %i%? \n")))
;;
;; Oh! Almost fur-got! I want to make Emacs a little more playful!
;; Let's add a custom function that will open a random Homestuck comic when I need a break.
(defun open-random-homestuck-comic ()
"Open a random Homestuck comic."
(interactive)
(let ((comic-no (random 8129)))
(browse-url (format "https://www.homestuck.com/story/%d" (+ comic-no 1)))))
;;(defun tag-new-node-as-draft ()
;; (org-roam-tag-add '("draft")))
;;(add-hook 'org-roam-capture-new-node-hook #'tag-new-node-as-draft)
;; Obliterate contents of the buffer *scratch*
;;
(defun scratch-setup ()
(with-current-buffer "*scratch*"
;;(erase-buffer) ; Clear the existing content
(insert "\n;; hey fuck you, also speedbar B)")))
;;(scratch-setup)
;;
;; god i fucking love homestuck
;; yoinked from Nicolas Petton
(setq org-refile-targets '(("~/org/projects.org" :maxlevel . 3)
("~/org/someday.org" :level . 1)
("~/org/freeprojects.org" :level . 1)
("~/org/tickler.org" :maxlevel . 2)))
(setq org-agenda-files '("~/org/inbox.org"
"~/org/projects.org"
"~/org/tickler.org"))
(setq org-todo-keywords '((sequence "TODO(t)" "URGENT TODO(ut)" "WAITING(w)" "QUESTION(q)" "IDEA(i)" "|" "DONE(d)" "CANCELLED(c)" "ANSWER(a)")))
;; auto commit on capture
(defun org-capture-git-prep (&rest args)
"Prepare for Org capture by pulling changes from Git."
(let ((default-directory "~/org/"))
;; Pull changes from Git
(shell-command "git pull")
;; Revert org buffers if they are already open
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (and (derived-mode-p 'org-mode)
(not (buffer-modified-p)))
(revert-buffer t t))))))
(advice-add 'org-capture :before #'org-capture-git-prep)
(defun org-capture-git-commit-push ()
"Commit and push changes in the Orgfiles repository after Org capture."
(let ((default-directory "~/org/"))
(shell-command "git add .")
(shell-command "git commit -m 'Auto-commit from Org capture'")
(shell-command "git push")))
(add-hook 'org-capture-after-finalize-hook 'org-capture-git-commit-push)
;; directory stuffs
(unless (file-exists-p "~/.emacs.d/autosaves")
(make-directory "~/.emacs.d/autosaves" t))
(setq backup-directory-alist `(("." . "~/.emacs.d/autosaves")))
(setq temporary-file-directory "~/.emacs.d/autosaves")
;;;; mail shit yo
;;(straight-use-package 'mu4e)
;;;;(require 'mu4e)
;;(setq mu4e-maildir "~/.mail") ;; Set this to the path of your Maildir
;;
;;(setq mu4e-get-mail-command "mbsync -a") ;; Set to your preferred method of fetching mail
;;(setq mu4e-update-interval 300) ;; Update every 5 minutes
;; directory stuffs
;;(unless (file-exists-p "~/.emacs.d/autosaves")
;; (make-directory "~/.emacs.d/autosaves" t))
;;(setq backup-directory-alist `(("." . "~/.emacs.d/autosaves")))
;;;; mail shit yo
;;(straight-use-package 'mu4e)
;;;;(require 'mu4e)
;;(setq mu4e-maildir "~/.mail") ;; Set this to the path of your Maildir
;;
;;(setq mu4e-get-mail-command "mbsync -a") ;; Set to your preferred method of fetching mail
;;(setq mu4e-update-interval 300) ;; Update every 5 minutes
;(setq-default indicate-empty-lines t)
;;(setq-default vim-empty-lines t)
(set-face-attribute 'default nil :height 144)
(setq default-directory "~/" )
(defun open-gtd-file ()
"Open the GTD file."
(interactive)
(find-file "~/org/projects.org"))
(global-set-key (kbd "C-c g") 'open-gtd-file)
;;(straight-use-package 'evil)
(straight-use-package 'nix-mode)
(straight-use-package 'projectile)
(straight-use-package 'ivy)
(straight-use-package 'dockerfile-mode)
(defun open-notes-file ()
"Open a file from the '~/org' directory.
If no input, opens a random.org file from the directory.
Otherwise, opens the file matching the input (without showing extensions or directories) or creates it if it doesn't exist."
(interactive)
(let* ((notes-dir "~/org")
(org-capture-git-prep)
(org-capture-git-commit-push); Your source control prep
(notes-files (directory-files notes-dir nil "^[^.].*")); Exclude hidden files/dirs
(completion-table
(lambda (string pred action)
(if (eq action 'metadata)
'(metadata (category . file))
(complete-with-action
action
(delq nil
(mapcar (lambda (file)
(unless (file-directory-p (concat notes-dir "/" file))
(file-name-sans-extension file)))
notes-files))
string
pred)))))
(let* ((input (completing-read "Open note: " completion-table nil nil)) ; Use nil for require-match to allow creating new files
(file-path (concat notes-dir "/" input ".org")))
(if (string= "" input)
(let* ((random-file (nth (random (length notes-files)) notes-files))
(random-file-path (concat notes-dir "/" random-file)))
(if (file-directory-p random-file-path)
(message "Selected file is a directory. Please try again.")
(find-file random-file-path)))
(if (file-exists-p file-path)
(find-file file-path)
;; Create the file if it doesn't exist
(progn
(find-file file-path)
(insert (format "#+TITLE: %s\n\n" input))
(message "New note created: %s" file-path)))))))
(global-set-key (kbd "C-c j") 'open-notes-file) ;; technically not org-roam but w/e
;;(projectile-mode)
(projectile-mode t) ;; huh? why +1 never seen that syntax..
(setq projectile-project-search-path '("~/Projects/"))
(projectile-add-known-project "~/today/")
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
;;(defun add-omen-to-projectile()
;; (setq projectile-project-search-path (projectile-project-search-path)) ;;"/ssh:six@faestep.666.com.co#49729:Projects")))
;; )
;;
;;(treemacs-project-follow-mode)
;;(projectile-clear-known-projects)
(setq projectile-enable-caching nil)
(setq projectile-completion-system 'ivy)
(global-set-key (kbd "C-c 7") 'org-date-from-calendar)
(global-set-key (kbd "C-c 8") 'org-mode-map)
(global-set-key (kbd "C-,") 'backward-sexp)
(global-set-key (kbd "C-.") 'forward-sexp)
;; rss here
(setq newsticker-url-list
'(("mf tailslide" "http://tailslide-comic.com/feed")
("homestuck beyond canon" "http://beyondcanon.com/story/feed")
("black bird spyplane :3" "http://www.blackbirdspyplane.com/feed")
("merriam webstos dayword " "http://www.merriam-webster.com/wotd/feed/rss2")
("midnight pub" "http://midnight.pub/feed.xml")
("playdte pod" "http://podcast.play.date/index.xml")))
(straight-use-package 'elpher)
(straight-use-package 'avy)
(global-set-key (kbd "C-;") 'avy-goto-char)
;; et
;; y mol
;; o gy
;;
;;
(defun slade/etymonbuf ()
"Look up word etymology notes from http://www.etymonline.com. Requires [[http://links.twibright.com/][links] to be installed."
(interactive)
(let ($p1 $p2 $input $result) ;; lifted from Xah Lee's 2018-08-16: "emacs, create link of word etymology"
(if (use-region-p)
(progn (setq $p1 (region-beginning))
(setq $p2 (region-end)))
(progn (setq $p1 (line-beginning-position))
(setq $p2 (line-end-position))))
(setq $input (buffer-substring-no-properties $p1 $p2)) ;;
(generate-new-buffer $input) ; generate new buffer titled with entry word
(switch-to-buffer (last-buffer)) ; switch to that new buffer
(insert (shell-command-to-string (concat "links -dump http://www.etymonline.com/word/" $input))) ; dump text via links from etymonline
(goto-char (point-min)) ; go to beginning
(if (re-search-forward "Error 404 (Not Found)" nil t) ; for non-word or words with no etymonline entry
(slade/word-not-found) ; if 404, kill buffer and display minibuffer message
(slade/trim-etymonbuf)))) ; otherwise trim off unneeded text from header and footer
(defun slade/trim-etymonbuf ()
"Trim off unneeded text from top and bottom."
(goto-char (point-min)) ; goto beginning of buffer
(search-forward "[\s\s]") ; the text output of links always delives text with a "[ ]" right before the text we want
(let ((begdel (point)))
(delete-region 1 begdel)) ; delete from beginning of buffer until "[ ]"
(goto-char (point-max)) ; goto end of buffer
(search-backward-regexp "Share[[:space:]]*Share on FacebookShare") ; the unneeded text at the bottom starts with a "Share" section
(let ((enddel (point)))
(delete-region (point-max) enddel)) ; delete from end of buffer until Share section
(goto-char (point-min))) ; move point back to beginning
(defun slade/word-not-found ()
"Delete buffer and display minibuffer message."
(kill-buffer)
(message "Sorry, word not found."))
(straight-use-package 'haki-theme)
(straight-use-package 'gameoflife)
(straight-use-package 'org-drill)
(straight-use-package 'nxhtml)
(straight-use-package 'ein)
;; doesnt work!!! yet..
;vvvvvvvv
;(defvar recent-changes-file "~/org/recent_changes.org")
;(defvar recent-changes-max-entries 200)
;
;
;(defun update-recent-changes (&rest _)
; "Update recent_changes.org with the latest Git diffs, organizing changes as subheadings."
; (let* ((default-directory "~/org/") ;; Set the directory here
; (diffs (shell-command-to-string "git diff --name-status")))
; (with-current-buffer (find-file-noselect recent-changes-file)
; (goto-char (point-min))
; (insert diffs)
; (org-mode)
; (while (re-search-forward "^\\([^[:space:]]\\+\\)[[:space:]]\\+\\([^[:space:]]\\+\\)$" nil t)
; (let* ((status (match-string 1))
; (filename (match-string 2))
; (file-heading (format "* %s" filename))
; (diff-output (if (string= filename "recent_changes.org")
; "" ;; Skip processing this file
; (shell-command-to-string (format "git diff --unified=0 %s" filename)))))
; (unless (string= filename "recent_changes.org") ;; Redundant check, but added for clarity
; (goto-char (point-min))
; (cond
; ((string= status "A")
; (insert file-heading "\n** File added\n" diff-output "\n"))
; ((string= status "D")
; (insert file-heading "\n** File deleted\n"))
; ((string= status "M")
; (if (re-search-forward file-heading nil t)
; (org-narrow-to-subtree)
; (progn
; (insert file-heading "\n")
; (org-narrow-to-subtree)))
; (with-temp-buffer
; (insert diff-output)
; (goto-char (point-min))
; (while (re-search-forward "^\\+\\([^*].*\\)$" nil t)
; (insert "** " (match-string 1) "\n"))
; (insert-buffer-substring (current-buffer) 0 (point-max)))
; (widen)))
; (while (> (length (org-map-entries t 'identity)) recent-changes-max-entries)
; (goto-char (point-max))
; (org-backward-heading-same-level 1)
; (org-narrow-to-subtree)
; (erase-subtree)
; (widen))))))))
;
;(advice-add 'org-capture-finalize :after (lambda (&rest _) (update-recent-changes)))
(setq my-repos '("~/Projects/many-winged/" "~/org/")) ;;"~/Projects/swargaso"))
;;;;
(defun review-yesterday (&optional date)
"Review commits from yesterday or a specific DATE (YYYY-MM-DD)."
(interactive
(list (if current-prefix-arg
(read-string "Enter date (YYYY-MM-DD): ")
(format-time-string "%Y-%m-%d" (time-add (current-time) (- (* 60 60 24)))))))
(let ((repo-diffs nil))
(dolist (repo my-repos)
(let* ((default-directory repo)
(log-command (if date
(format "git log --after='%s 00:00:00' --before='%s 23:59:59' --pretty=format:%%H --name-only --diff-filter=ACDMRTUXB --no-merges" date date)
(format "git log --after='%s 00:00:00' --before='%s 23:59:59' --pretty=format:%%H --name-only --diff-filter=ACDMRTUXB --no-merges"
(format-time-string "%Y-%m-%d" (time-add (current-time) (- (* 60 60 24))))
(format-time-string "%Y-%m-%d" (current-time)))))
(log-output (shell-command-to-string log-command))
(lines (split-string log-output "\n" t))
(current-commit nil)
(files nil))
(dolist (line lines)
(let ((line (string-trim line)))
(if (string-match "^[0-9a-f]+$" line) ; Check if it's a commit hash
(progn
(when current-commit ; Process previous commit
(dolist (file files)
(let ((diff-output (shell-command-to-string (format "git show %s --unified=0 -- %s" current-commit file))))
(when diff-output
(push (cons file diff-output) repo-diffs)))))
(setq current-commit line ; Start new commit
files nil)) ; Reset files list
(when current-commit ; Only add file if we have a commit
(push (concat default-directory line) files)))))
(when current-commit ; Process the last commit
(dolist (file files)
(let ((diff-output (shell-command-to-string (format "git show %s --unified=0 -- %s" current-commit file))))
(when diff-output
(push (cons file diff-output) repo-diffs))))))
(display-diffs repo-diffs))))
;;;;
(defun display-diffs (repo-diffs)
"Display the diffs in an Org mode buffer."
(with-current-buffer (get-buffer-create "*Yesterday's Changes*")
(read-only-mode 0) ;; Turn off read-only mode
(erase-buffer)
(insert "#+TITLE: Yesterday's Changes\n")
(dolist (diff repo-diffs)
(let ((file (car diff))
(diff-output (cdr diff)))
(insert (format "* %s\n" file))
(insert diff-output "\n")))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun review-last-n-commits (n &optional repo)
"Review the last N commits in REPO. If REPO is nil, review all repos in `my-repos'."
(interactive
(list (read-number "Enter number of commits: ")
(if current-prefix-arg
(read-string "Enter repo path: ")
nil)))
(let ((repo-diffs nil)
(repos (if repo (list repo) my-repos)))
(dolist (repo repos)
(let* ((default-directory repo)
(log-command (format "git log -n %d --pretty=format:%%H --name-only --diff-filter=ACDMRTUXB --no-merges" n))
(log-output (shell-command-to-string log-command))
(lines (split-string log-output "\n" t))
(current-commit nil)
(files nil))
(dolist (line lines)
(let ((line (string-trim line)))
(if (string-match "^[0-9a-f]+$" line) ; Check if it's a commit hash
(progn
(when current-commit ; Process previous commit
(dolist (file files)
(let ((diff-output (shell-command-to-string (format "git show %s --unified=0 -- %s" current-commit file))))
(when diff-output
(push (cons file diff-output) repo-diffs)))))
(setq current-commit line ; Start new commit
files nil)) ; Reset files list
(when current-commit ; Only add file if we have a commit
(push (concat default-directory line) files)))))
(when current-commit ; Process the last commit
(dolist (file files)
(let ((diff-output (shell-command-to-string (format "git show %s --unified=0 -- %s" current-commit file))))
(when diff-output
(push (cons file diff-output) repo-diffs))))))
(display-last-n-commits-diffs repo-diffs))))
;;;;
(defun display-last-n-commits-diffs (repo-diffs)
"Display the diffs in an Org mode buffer."
(with-current-buffer (get-buffer-create "*Last N Commits*")
(read-only-mode 0) ;; Turn off read-only mode
(erase-buffer)
(insert "#+TITLE: Last N Commits\n")
(dolist (diff repo-diffs)
(let ((file (car diff))
(diff-output (cdr diff)))
(insert (format "* %s\n" file))
(insert diff-output "\n")))))
;;
;;; brand workflow helpers
;;;
(setq brand-modules-base-path (expand-file-name "~/Projects/NGEC/brand-modules"))
(defun get-brand-module-derivative-names ()
"Return a list of possible derivative names in brand-modules structure."
(let ((pattern (concat brand-modules-base-path "/*/derivatives/*")))
(mapcar 'file-name-nondirectory
(file-expand-wildcards pattern))))
;;(defun get-brand-module-graph-names ()
;; "Return a list of possible graph names in brand-modules structure."
;; (let ((pattern (concat brand-modules-base-path "/*/graphs/*/*")))
;; (mapcar 'file-name-nondirectory
;; (file-expand-wildcards pattern))))
(defun get-brand-module-node-names ()
"Return a list of possible node names in brand-modules structure."
(let ((pattern (concat brand-modules-base-path "/*/nodes/*")))
(mapcar 'file-name-nondirectory
(file-expand-wildcards pattern))))
;;;
;;;
;;;
(defun brand-node-open (node-name)
"Open a brand node directory"
(interactive
(list
(completing-read "Enter node name: " (get-brand-module-node-names) nil t)))
(let* ((pattern (concat brand-modules-base-path "/*/nodes/" node-name))
(matching-dirs (file-expand-wildcards pattern))
(dir-count (length matching-dirs)))
(cond
((zerop dir-count)
(message "No node directory found with name '%s'" node-name))
((= 1 dir-count)
(dired (car matching-dirs)))
(t
(let ((chosen-dir (completing-read "Choose module for node:" matching-dirs nil t)))
(dired chosen-dir))))))
;;;
;;;
;;;
;;(defun brand-graph-open (graph-name)
;; "Open a brand graph"
;; (interactive
;; (list
;; (completing-read "Enter graph name: " (get-brand-module-graph-names) nil t)))
;; (let* ((pattern (concat brand-modules-base-path "/*/graphs/" graph-name))
;; (matching-dirs (file-expand-wildcards pattern))
;; (dir-count (length matching-dirs)))
;; (cond
;; ((zerop dir-count)
;; (message "No graph directory found with name '%s'" graph-name))
;; ((= 1 dir-count)
;; (dired (car matching-dirs)))
;; (t
;; (let ((chosen-dir (completing-read "Choose module for graph:" matching-dirs nil t)))
;; (dired chosen-dir))))))
;;;
;;;
;;;
(defun brand-derivative-open (derivative-name)
"Open a directory in the brand-modules file structure with tab completion for derivative names.
This function takes the name of a directory in the 'derivatives' folder
as input. It relies on the variable `brand-modules-base-path`
which should be preset to the path of the 'brand-modules' directory.
It provides tab completion for derivative names.
If multiple derivatives with the same name are found in different
module folders, it prompts the user to choose which one to open."
(interactive
(list
(completing-read "Enter derivative name: " (get-brand-module-derivative-names) nil t)))
(let* ((pattern (concat brand-modules-base-path "/*/derivatives/" derivative-name))
(matching-dirs (file-expand-wildcards pattern))
(dir-count (length matching-dirs)))
(cond
((zerop dir-count)
(message "No derivative directory found with name '%s'" derivative-name))
((= 1 dir-count)
(dired (car matching-dirs)))
(t
(let ((chosen-dir (completing-read "Choose module for derivative:" matching-dirs nil t)))
(dired chosen-dir))))))
(global-visual-line-mode t)
;; Example usage:
;; (interactive)
;; (open-brand-module-node-directory "your-node-name")
;;
;;
;;
;;
;;;;
;;
;;;;
;;
;;;;
;;
;;;;
;;
;;
;;
;;;;;
;;
;; ; ; ; ; ; ;
;; "In Any Attempt, Perfection is Surpassed"
;; ; ; ; ; ; ;
;;
;;; ; ; ;
;; "So long as you retain your spirit of exploration, surely you shall find your way out. This I believe."
;;;;; ; ; ; ;; ; ; ;;; ; ; ; ; ; ; ; ;
;;