diff options
| author | Dylan <boss@tehbox.org> | 2026-10-22 13:02:16 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-10-22 17:19:36 +1300 |
| commit | cc47c443a3f86aa66d2719ee57c0e6e728ee655e (patch) | |
| tree | 6e57c4e13cf07486d4a02a3652bf84a9889f97a6 /modules/home-manager/emacs/config | |
| parent | 008b591a0a5942ae42f4c07a5abbee4dbd2d0743 (diff) | |
| download | nixos-configuration-cc47c443a3f86aa66d2719ee57c0e6e728ee655e.tar.gz nixos-configuration-cc47c443a3f86aa66d2719ee57c0e6e728ee655e.zip | |
feat: Included the emacs configdendritic
Some packages are built with nix and some are still built with emacs
Diffstat (limited to 'modules/home-manager/emacs/config')
22 files changed, 1843 insertions, 0 deletions
diff --git a/modules/home-manager/emacs/config/config/teh-config-auth.el b/modules/home-manager/emacs/config/config/teh-config-auth.el new file mode 100644 index 0000000..afff6fa --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-auth.el @@ -0,0 +1,18 @@ +;;; teh-config-auth.el --- My config - Auth config +;;; Commentary: +;;; Unix pass and totp + +;;; Code: + +;; Unix pass +(auth-source-pass-enable) +(setq auth-source-pass-filename "~/.password-store") +(setq auth-sources '(password-store "~/.authinfo.gpg" "~/.authinfo" "~/.netrc")) +(use-package pass) ;; For viewing passwords, not sure if i should keep + +;; Totp +(use-package totp) + +(provide 'teh-config-auth) + +;;; teh-config-auth.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-completion.el b/modules/home-manager/emacs/config/config/teh-config-completion.el new file mode 100644 index 0000000..0f10b4c --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-completion.el @@ -0,0 +1,99 @@ +;;; teh-config-completion.el --- My config - completion +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Eglot +(use-package eglot + :config (setq eglot-autoshutdown t) + (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))) +(use-package eldoc-box + :config (add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-at-point-mode t)) + +;;; Corfu +(use-package corfu + :diminish + :after eglot + :hook (eglot-managed-mode . corfu-mode) + :config + (global-corfu-mode 1) + ;;(corfu-popupinfo-mode) + (corfu-popupinfo-mode 1) + (setq corfu-auto t + corfu-quit-no-match 'separator + corfu-auto-delay 0) + (set-face-bold 'corfu-current t) + (set-face-background 'corfu-current "#4E5579") + (set-face-foreground 'corfu-current nil) + (set-face-bold 'orderless-match-face-0 t) + (set-face-background 'orderless-match-face-0 nil) + (set-face-foreground 'orderless-match-face-0 "#C792EA") + (set-face-foreground 'completions-common-part "#C792EA") + (set-face-bold 'vertico-current t)) + +(use-package kind-icon :after corfu + :custom + (kind-icon-default-face 'corfu-default) + :config + (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter) + (setq kind-icon-blend-background nil)) + +;;; Languages +(use-package nix-mode + :mode "\\.nix\\'" + :config + (add-hook 'nix-mode-hook (lambda () (setq tab-width 4)))) +(use-package haskell-mode) +(use-package typst-ts-mode) +(use-package glsl-mode) +(use-package rust-mode) +;; (treesit-install-language-grammar 'typescript) +;; (treesit-install-language-grammar 'tsx) +(use-package typescript-ts-mode + :mode (("\\.ts\\'" . typescript-ts-mode) + ("\\.tsx\\'" . tsx-ts-mode))) + +;; (use-package jupyter) +(use-package ein) +;; (use-package code-cells) + + +;; Hooks to start eglot +(use-package typescript-mode) +(add-hook 'c-mode-hook 'eglot-ensure) +(add-hook 'c++-mode-hook 'eglot-ensure) +(add-hook 'js-mode-hook 'eglot-ensure) +(add-hook 'ts-mode-hook 'eglot-ensure) +(add-hook 'nix-mode-hook 'eglot-ensure) +(add-hook 'java-mode-hook 'eglot-ensure) +(add-hook 'haskell-mode-hook 'eglot-ensure) +(add-hook 'rust-mode-hook 'eglot-ensure) +(add-hook 'emacs-lisp-mode-hook 'corfu-mode) +;;;(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) + +;;; Treesitter +(use-package tree-sitter + :config + (global-tree-sitter-mode) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) +(use-package tree-sitter-langs :after tree-sitter) + +;;; Imenu +(add-hook 'emacs-lisp-mode-hook (lambda () + (add-to-list 'imenu-generic-expression '("Title" "^;;; \\(.*\\)$" 1)))) + +;;; Ghostel (terminal backend for Claude Code) +(use-package ghostel) + +;;; Claude code +(use-package claude-code-ide + :vc (:url "https://github.com/manzaltu/claude-code-ide.el" :rev :newest) + :bind ("C-c C-'" . claude-code-ide-menu) + :config + (setq claude-code-ide-terminal-backend 'ghostel) + (claude-code-ide-emacs-tools-setup)) + +(provide 'teh-config-completion) + +;;; teh-config-completion.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-emms.el b/modules/home-manager/emacs/config/config/teh-config-emms.el new file mode 100644 index 0000000..fb77980 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-emms.el @@ -0,0 +1,17 @@ +;;; teh-config-emms.el --- My config for emms +;;; Commentary: +;;; My config files + +;;; Code: + +(use-package emms + :config + (emms-all) + (setq emms-player-list '(emms-player-mpv) + emms-info-functions '(emms-info-native)) + (emms-add-directory-tree "~/Music") + (emms-mode-line-enable)) + +(provide 'teh-config-emms) + +;;; teh-config-emms.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-erc.el b/modules/home-manager/emacs/config/config/teh-config-erc.el new file mode 100644 index 0000000..9611f3f --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-erc.el @@ -0,0 +1,188 @@ +;;; teh-config-erc.el --- My config +;;; Commentary: +;;; My config files + +;;; Code: + +(require 'erc) + +;; erc-sasl +(require 'erc-sasl) +;; Add SASL server to list of SASL servers (start a new list, if it did not exist) +(add-to-list 'erc-sasl-server-regexp-list "irc\\.libera\\.chat") +;; Redefine/Override the erc-login() function from the erc package, so that +;; it now uses SASL +;; (defun erc-login () +;; "Perform user authentication at the IRC server. (PATCHED)" +;; (erc-log (format "login: nick: %s, user: %s %s %s :%s" +;; (erc-current-nick) +;; (user-login-name) +;; (or erc-system-name (system-name)) +;; erc-session-server +;; erc-session-user-full-name)) +;; (if erc-session-password +;; (erc-server-send (format "PASS %s:%s" (erc-current-nick) erc-session-password)) +;; (message "Logging in without password")) +;; (when (and (featurep 'erc-sasl) (erc-sasl-use-sasl-p)) +;; (erc-server-send "CAP REQ :sasl")) +;; (erc-server-send (format "NICK %s" (erc-current-nick))) +;; (erc-server-send +;; (format "USER %s %s %s :%s" +;; ;; hacked - S.B. +;; (if erc-anonymous-login erc-email-userid (user-login-name)) +;; "0" "*" +;; erc-session-user-full-name)) +;; (erc-update-mode-line)) + +(defun erc-login () + "Perform user authentication at the IRC server." + (erc-log (format "login: nick: %s, user: %s %s %s :%s" + (erc-current-nick) + (user-login-name) + (or erc-system-name (system-name)) + erc-session-server + erc-session-user-full-name)) + (if erc-session-password + (erc-server-send (concat "PASS " (erc-current-nick) ":" (erc--unfun erc-session-password))) + (message "Logging in without password")) + (erc-server-send (format "NICK %s" (erc-current-nick))) + (erc-server-send + (format "USER %s %s %s :%s" + ;; hacked - S.B. + erc-session-username + "0" "*" + erc-session-user-full-name)) + (erc-update-mode-line)) + +(setq erc-format-nick-function 'erc-format-@nick) + +;;; Truncating +(add-hook 'erc-mode-hook 'erc-truncate-disable) +(add-hook 'erc-mode-hook (lambda () (erc-truncate-mode 0))) +(defun erc-cmd-TRUNCATE () (interactive) + (erc-truncate-buffer) + (end-of-buffer)) +(define-key erc-mode-map (kbd "C-c t") 'erc-cmd-TRUNCATE) + +;;; Completion +(add-hook 'erc-mode-hook 'corfu-mode) + +;;; Keybindings +(defun erc-reconnect () (interactive) + (erc-cmd-RECONNECT)) +(define-key erc-mode-map (kbd "C-c r") 'erc-reconnect) + +(defun erc-cmd-RAT () (interactive) + (erc-send-message "~~,=,^>")) +(define-key erc-mode-map (kbd "C-c P") 'erc-cmd-RAT) + +;;; Join config +(setq erc-server "tehbox.org" + erc-port 5000 + erc-nick "boss/rizon" + erc-track-shorten-start 8 + erc-autojoin-delay 0 + erc-autojoin-timing 'ident + erc-kill-buffer-on-part t + erc-kill-buffer-on-quit t + erc-auto-query 'bury + erc-max-buffer-size 350000 + erc-insert-timestamp-function 'erc-insert-timestamp-right + erc-timestamp-format "[%H:%M]" + erc-timestamp-format-left "[%H:%M]" + erc-timestamp-format-right "[%H:%M]") + +(defun erc-server-reconnect () + "Reestablish the current IRC connection. +Make sure you are in an ERC buffer when running this." + (let ((buffer (erc-server-buffer))) + (unless (buffer-live-p buffer) + (if (eq major-mode 'erc-mode) + (setq buffer (current-buffer)) + (error "Reconnect must be run from an ERC buffer"))) + (with-current-buffer buffer + (erc-update-mode-line) + (erc-set-active-buffer (current-buffer)) + (setq erc-server-last-sent-time 0) + (setq erc-server-lines-sent 0) + (let ((erc-server-connect-function (or erc-session-connector + #'erc-open-network-stream)) + (erc--server-reconnecting (buffer-local-variables))) + (erc-open erc-session-server erc-session-port erc-nick + erc-session-user-full-name t erc-session-password + nil nil nil erc-session-client-certificate + erc-session-username + (erc-networks--id-given erc-networks--id)) + (defvar erc-reuse-buffers) + (unless (with-suppressed-warnings ((obsolete erc-reuse-buffers)) + erc-reuse-buffers) + (cl-assert (not (eq buffer (current-buffer))))))))) + +;; Nick highlighting +;; (use-package erc-hl-nicks +;; :after erc +;; :config +;; ;;; Face for my nick +;; (defface erc-nick-face +;; '((t +;; :foreground "#c792ea" +;; :inherit 'erc-hl-nicks-nick-base-face)) +;; "Face for your nick in ERC" +;; :group 'erc-hl-nicks) +;; (set-face-attribute 'erc-my-nick-face nil :foreground "#c792ea") +;; ;;; Change highlighting function +;; (defun erc-hl-nicks-make-face (nick) +;; "Create and cache a new face for the given nick" +;; (if (string-equal-ignore-case nick (erc-current-nick)) +;; "erc-nick-face" +;; (or +;; (gethash (if (string-match "j+[oa]k+e" (downcase nick)) "jjakke" (downcase nick)) ;erc-hl-nicks-face-table) +;; (let ((color (erc-hl-nicks-color-for-nick (downcase nick))) +;; (new-nick-face (erc-hl-nicks-face-name (downcase nick)))) +;; (copy-face 'erc-hl-nicks-nick-base-face new-nick-face) +;; (set-face-foreground new-nick-face color) +;; (puthash (downcase nick) new-nick-face erc-hl-nicks-face-table))))) +;; (erc-hl-nicks-force-nick-face "jjakke" "#ff5050" t))) + +;; Command alias +(defalias 'erc-cmd-LL 'erc-cmd-LASTLOG) + +;;; Mentions +(define-minor-mode erc-mentions-mode + "Enables ERC mention recording" + nil + :global t + :lighter " ERC mentions" + :init-value nil + (defun update-mentions (arg1 response) + (let ((contents (erc-response.contents response))) + (when (string-match (regexp-quote (erc-current-nick)) contents) + (save-excursion + (set-buffer (get-buffer-create "*ERC Mentions*")) + (erc-mentions-list-mode) + (let ((inhibit-read-only t)) + (end-of-buffer) + (insert (current-time-string) ": <" (car (split-string (erc-response.sender response) "!")) "> " contents "\n") + ) + (end-of-buffer) + ))) + nil) + (if erc-mentions-mode + (progn + (add-hook 'erc-server-PRIVMSG-functions 'update-mentions) + (message "ERC mentions mode enabled")) + (progn + (remove-hook 'erc-server-PRIVMSG-functions 'update-mentions) + (message "ERC mentions mode disabled")))) +(define-derived-mode erc-mentions-list-mode + special-mode "*ERC Mentions*" + "Mode for the ERC mentions list" + :interactive nil) +(add-to-list 'auto-mode-alist '("\\*ERC Mentions\\*\\'" . erc-mentions-list-mode)) + +(use-package jabber) + + +(provide 'teh-config-erc) + +;;; teh-config-erc.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-general.el b/modules/home-manager/emacs/config/config/teh-config-general.el new file mode 100644 index 0000000..619925e --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-general.el @@ -0,0 +1,174 @@ +;;; teh-config-general.el --- My config - General config +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Recent +(use-package recentf + :config + (recentf-mode)) + +;;; Sudo edit +(use-package sudo-edit) + +;;; Vertico +(use-package vertico + :init (vertico-mode) + :config (setq vertico-cycle t)) + +;;; Marginalia +(use-package marginalia :after vertico + :init (marginalia-mode)) + +;;; Orderless +(use-package orderless + :config + (define-minor-mode orderless-mode + "Toggles orderless" + nil + :global t + :group 'orderless + :lighter " Orderless" + + (if orderless-mode + (progn + (setq completion-styles '(orderless basic)) + (message "Orderless mode enabled")) + (progn + (setq completion-styles '(basic partial-completion emacs22)) + (message "Orderless mode disabled")))) + (orderless-mode) + (diminish 'orderless-mode)) + +;;; Consult +(use-package consult + :bind (("C-S-s" . consult-line) + ("C-x b" . consult-buffer))) + +;;; Embark +(use-package embark + :bind (("C-\\" . embark-act))) + +;;; Embark consult +(use-package embark-consult) + +;;; Vterm +;; (use-package vterm +;; :config +;; (setq vterm-environment '("EDITOR=emacsclient"))) +;; (use-package multi-vterm) + +;;; Ghostel +(use-package ghostel) + +;;; Popterm (terminal toggler; replaces multi-vterm, backed by ghostel) +(use-package posframe) +(use-package popterm + :config + (setq popterm-backend 'ghostel + popterm-display-method 'window + popterm-scope 'project + popterm-auto-cd t) + (popterm-global-mode 1)) + +;;; Helpful +(use-package helpful + :bind + (("C-h f" . helpful-callable) + ("C-h v" . helpful-variable) + ("C-h k" . helpful-key) + ("C-h x" . helpful-command))) + +;;; Backups +(setq backup-directory-alist `(("" . "~/.saves") ("." . "~/.saves") (".*" . "~/.saves"))) +(setq delete-old-versions t + version-control t) + +;;; Magit +(use-package magit + :config + (add-hook 'magit-process-find-password-functions + 'magit-process-password-auth-source)) + +;;; Projectile +(defun projectile-run-ghostel (&optional arg) + "Invoke `ghostel' in the project's root. + +Switch to the project specific ghostel buffer if it already exists. + +Use a prefix argument ARG to indicate creation of a new instance instead." + (interactive "P") + (unless (require 'ghostel nil 'noerror) + (error "Package `ghostel' is not available")) + (let* ((project (projectile-acquire-root)) + (ghostel-buffer-name (format "*ghostel %s*" (projectile-project-name project))) + (default-directory project)) + (ghostel arg))) + +(defun projectile-claude-code-ide-menu () + "Open `claude-code-ide-menu' for a projectile project. + +The menu's commands run after it returns, so binding `default-directory' +isn't enough; when the chosen project isn't the current one, visit its +root first so the menu acts on it." + (interactive) + (let ((project (projectile-acquire-root))) + (unless (equal project (projectile-project-root)) + (dired project)) + (call-interactively #'claude-code-ide-menu))) + +(use-package projectile + :diminish + :config + (projectile-mode +1) + (define-key projectile-mode-map + (kbd "C-c p") 'projectile-command-map) + ;; Overrides the stock "x v" -> `projectile-run-vterm' binding; comment + ;; this out to fall back to it. + (define-key projectile-command-map (kbd "x v") #'projectile-run-ghostel) + (define-key projectile-command-map (kbd "C-'") #'projectile-claude-code-ide-menu)) + +;;; Treemacs +(use-package treemacs) +(use-package treemacs-projectile + :after treemacs projectile) + +;;; Occur +(defun occur-scroll () + (end-of-buffer-other-window 0)) +(add-hook 'occur-hook 'occur-scroll) + +;;; Dired +(setq dired-kill-when-opening-new-dired-buffer t) +;(use-package diredc +; :load-path "~/.emacs.d/packages/emacs-diredc" +; :bind (("C-x C-d" . diredc)) +; :custom +; (diredc-make-new-frame nil)) +(use-package casual-dired + :bind (:map dired-mode-map ("C-o" . 'casual-dired-tmenu))) + +;;; Direnv +(use-package direnv + :config + (direnv-mode)) + +;;; Qalc +(require 'qalc) + +;;; Random stuff +;;(tab-bar-mode 1) +(setq use-short-answers t) +(setq sentence-end-double-space nil) +(delete-selection-mode 1) +(defun emacs () + (interactive) + (message "Godly editor")) +(defun vim () + (interactive) + (message "Spawn of the devil")) + +(provide 'teh-config-general) + +;;; teh-config-general.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-keybinds.el b/modules/home-manager/emacs/config/config/teh-config-keybinds.el new file mode 100644 index 0000000..f3e6b71 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-keybinds.el @@ -0,0 +1,119 @@ +;;; teh-config-keybinds.el --- My config keybinds +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Keymap mode +;;; https://emacs.stackexchange.com/questions/65080/stop-major-modes-from-overwriting-my-keybinding +;; (defvar tehkeys-keymap (make-keymap) +;; "Keymap for tehkeys-mode") + +;; (define-minor-mode tehkeys-mode +;; "Minor mode for my personal keybindings." +;; :init-value t +;; :global t +;; :keymap tehkeys-keymap) + +;; (add-to-list 'emulation-mode-map-alists +;; `((tehkeys-mode . ,tehkeys-keymap))) + +;;; Window jumping +(use-package ace-window + :bind* (("M-o" . 'ace-window)) + :bind (("M-o" . 'ace-window)) + :config + (setq aw-dispactch-always t + aw-dispatch-when-more-than 1 + aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) + (ace-window-display-mode 1) + (set-face-attribute 'aw-mode-line-face nil :foreground "#ff5370" :weight 'bold) + (set-face-attribute 'aw-leading-char-face nil :weight 'bold :height 4.0)) +;;; Window zooming +(defun teh/zoom-window-ignore-side-windows (orig &rest args) + "Call ORIG with `ignore-window-parameters' set, so zooming also hides +side windows (e.g. claude-code-ide) that set `no-delete-other-windows'." + (let ((ignore-window-parameters t)) + (apply orig args))) +(use-package zoom-window + :bind (("C-x 1" . zoom-window-zoom)) + :config + (advice-add 'zoom-window-zoom :around #'teh/zoom-window-ignore-side-windows)) +;;(general-define-key :prefix "M-o" +;; "p" 'windmove-up +;; "n" 'windmove-down +;; "f" 'windmove-right +;; "b" 'windmove-left) + +;;; Require lisp for keybinds +(require 'insert-date) +(require 'recentf) +;; (require 'teh-config-mu4e) +;; (require 'multi-vterm) +(require 'popterm) +(require 'consult) +(require 'org) +(require 'org-roam) + +;;; Init emacs says +(require 'emacs-says) +(emacs-says-load-quotes) + +;;; Which key +(use-package which-key + :diminish + :init (which-key-mode)) + +;;; General keybinds +(global-unset-key (kbd "C-z")) +(use-package general) +(general-create-definer leader-def + :prefix "C-z") +(leader-def + "i" 'consult-imenu + "f" '(:which-key "Files") + "f r" 'consult-recent-file + "f c" (lambda () (interactive) (cd "~/.emacs.d/config") (call-interactively 'find-file)) + ;; "e" 'mu4e-open + ;; "RET" 'multi-vterm + "RET" 'popterm-toggle-cd + "d" 'insert-date + "r" '(:which-key "Random") + "r q" 'emacs-says-quote + "m" '(:which-key "Music") + "m p" 'emms-pause + "m r" '(:which-key "Repeat") + "m r t" 'emms-toggle-repeat-track + "m r p" 'emms-toggle-repeat-playlist + "o" '(:which-key "Org mode") + "o b" 'org-switchb + "o a" 'org-agenda + "o f" 'org-roam-node-find + "o c" '(:which-key "Capture") + "o c r" 'org-roam-capture + "o c t" 'org-capture + "o t" 'org-roam-tag-add + "o l" 'org-roam-node-insert + ) +(general-define-key "C-x C-b" 'ibuffer) +(general-define-key :keymaps 'flymake-mode-map + "C-c e" 'flymake-goto-next-error + "C-c E" 'flymake-goto-prev-error) +(general-define-key :keymaps 'eglot-mode-map + "C-c a" 'eglot-code-actions + "C-c r" 'eglot-rename) + + +;;; Remove annoying keybinds +(global-unset-key (kbd "C-<mouse-4>")) +(global-unset-key (kbd "C-<mouse-5>")) +(global-unset-key (kbd "C-<wheel-down>")) +(global-unset-key (kbd "C-<wheel-up>")) + +;;; Misc +(global-subword-mode 1) +(diminish 'subword-mode) + +(provide 'teh-config-keybinds) + +;;; teh-config-keybinds.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-looks.el b/modules/home-manager/emacs/config/config/teh-config-looks.el new file mode 100644 index 0000000..4030d81 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-looks.el @@ -0,0 +1,138 @@ +;;; teh-config-looks.el --- My config looks +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Colorscheme +(use-package doom-themes + :config + (setq doom-themes-enable-bold t + doom-themes-ename-italic t) + (load-theme 'doom-palenight t) + (doom-themes-visual-bell-config) + (doom-themes-org-config)) + +;;; Diminishing modes +(use-package diminish) + +;;; Fonts +;;; Normal +(set-face-attribute 'isearch nil + :underline t) +(set-face-attribute 'default nil + :font "Cousine Nerd Font 10" + :weight 'medium) +(set-face-attribute 'variable-pitch nil + :font "Cousine Nerd Font 10" + :weight 'medium) +(set-face-attribute 'fixed-pitch nil + :font "Cousine Nerd Font 10" + :weight 'medium) +(add-to-list 'default-frame-alist '(font . "Cousine Nerd Font 10")) +(set-frame-font "Cousine Nerd Font 10") +;;; Emoji +(set-fontset-font t 'emoji + '("Noto Color Emoji" . "iso10646-1") nil 'prepend) + +;;; Transparency +(set-frame-parameter (selected-frame) 'alpha '(80 . 80)) +(add-to-list 'default-frame-alist '(alpha . (80 . 80))) +;;(set-frame-parameter nil 'alpha-background 80) +;;(add-to-list 'default-frame-alist '(alpha-background . 80)) + +;;; No bars +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +;;; Fix scroll +(setq scroll-conservatively 10000 + scroll-preserve-screen-position 1) + +;;; Line numbers and visual lines +(global-display-line-numbers-mode 1) +(global-visual-line-mode 1) +(add-hook 'org-mode-hook (lambda () (display-line-numbers-mode 0))) +(diminish 'visual-line-mode) + +;;; Cursor +(setq-default cursor-type 'bar) + +;;; Tabs +(electric-indent-mode 1) +(setq tab-width 4 + c-default-style "linux") +(setq-default indent-tabs-mode t + tab-width 4) +(defvaralias 'c-basic-offset 'tab-width) + +;;; ibuffer +(add-hook 'ibuffer-mode-hook + (lambda () + (ibuffer-switch-to-saved-filter-groups "Default") + (setq ibuffer-show-empty-filter-groups nil) + (ibuffer-auto-mode 1))) +(setq ibuffer-saved-filter-groups + '(("Default" + ("Files" (filename . "[~\/].*")) + ("ERC" (mode . erc-mode)) + ("System" (name . "\*.*\*")) + ("Modified" (predicate buffer-modified-p (current-buffer))) + ("Other" (name . ".*")) + ))) + +;;; Icons +(use-package nerd-icons) + +;;; Dashboard +(use-package dashboard :after nerd-icons + :config + (setq dashboard-set-heading-icons t + dashboard-set-navigator t + dashboard-set-file-icons t + dashboard-startup-banner "~/.emacs.d/gnu.png" + dashboard-banner-logo-title "\\(^-^)/" + dashboard-set-init-info t + dashboard-center-content t + dashboard-items '((recents . 10) + (projects . 5 ) + (bookmarks . 5))) + (add-hook 'dashboard-mode #'display-line-numbers-mode) + (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) + (dashboard-setup-startup-hook) + (dashboard-modify-heading-icons '((recents . "file-text") + (bookmarks . "book")))) + +;;; Tree sitter +(use-package tree-sitter :diminish + :config + (global-tree-sitter-mode) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) +(use-package tree-sitter-langs :after tree-sitter) + +;;; Modeline - DISABLED +;;;(use-package doom-modeline + ;;;:after nerd-icons + ;;;:config + ;;;(doom-modeline-mode 1) + ;;;(setq doom-modeline-buffer-file-name-style 'relative-from-project + ;;;doom-modeline-hud nil)) + +;;; Mark - DISABLED +;;(use-package visible-mark + ;;:config (transient-mark-mode 0) + ;;(global-visible-mark-mode t) + ;;(warn "Transient mark mode disabled") + ;;) + +;;; Beacon - DISABLED +;;;(use-package beacon + ;;;:config (beacon-mode 1) + ;;;(setq beacon-color "#c792ea" + ;;;beacon-blink-delay 0 + ;;;beacon-blink-duration 0.6)) + +(provide 'teh-config-looks) + +;;; teh-config-looks.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-mu4e.el b/modules/home-manager/emacs/config/config/teh-config-mu4e.el new file mode 100644 index 0000000..2d0ab85 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-mu4e.el @@ -0,0 +1,57 @@ +;;; teh-config-mu4e.el --- My config - mu4e +;;; Commentary: +;;; My config files + +;;; Code: + +;;(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e") +(use-package mu4e + :ensure nil + :config + (setq mu4e-mu-binary (executable-find "mu")) + (setq user-mail-address "boss@tehbox.org") + + ;; SMTP settings: + (setq send-mail-function 'smtpmail-send-it + smtpmail-smtp-server "tehbox.org" + smtpmail-smtp-user "boss" + smtpmail-mail-address "boss@tehbox.org" + smtpmail-smtp-service 587 + smtpmail-stream-type 'starttls) + + ;; Mail folders: + (setq mu4e-drafts-folder "/drafts" + mu4e-sent-folder "/sent" + mu4e-trash-folder "/trash") + + ;; The command used to get your emails (adapt this line, see section 2.3): + (setq mu4e--get-mail-password-regexp "^Password (tehbox): $" + mu4e-get-mail-command "mbsync --config ~/.emacs.d/.mbsyncrc tehbox" + mu4e-change-filenames-when-moving t) + (defun mu4e-open () (interactive) + (mu4e-update-mail-and-index nil) + (mu4e nil)) + + ;; Further customization: + (setq mu4e-html2text-command "w3m -T text/html" + mu4e-update-interval 300 + mu4e-headers-auto-update nil + mu4e-view-show-images t + mu4e-compose-signature-auto-include nil + mu4e-use-fancy-chars t) + + ;; Functions + (defun mu4e-email-file (&optional file) + "Starts an email with FILE as an attachment, defaults to current open file" + (interactive) + (unless file + (setq file (buffer-file-name))) + (if (file-exists-p file) + (progn + (mu4e-compose-new) + (mail-add-attachment file)) + (message "Not a file")))) + +(provide 'teh-config-mu4e) + +;;; teh-config-mu4e.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-org-mode.el b/modules/home-manager/emacs/config/config/teh-config-org-mode.el new file mode 100644 index 0000000..38d1b90 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-org-mode.el @@ -0,0 +1,108 @@ +;;; teh-config-org-mode.el --- My config - <BLANK> +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Fancy stars +(use-package org-superstar + :after org + :hook (org-mode . org-superstar-mode) + :config + (setq org-hide-leading-stars nil + org-superstar-leading-bullet ?\s + org-imenu-depth 3)) + +;;; Fancy header outdent +(use-package org-margin + :ensure nil ; built by Nix + :config + (add-hook 'org-mode-hook (lambda () (org-margin-mode 1)))) + + +;;; NO spell check for embedded snippets +(defadvice org-mode-flyspell-verify (after org-mode-flyspell-verify-hack activate) + (let* ((rlt ad-return-value) + (begin-regexp "^[ \t]*#\\+begin_\\(src\\|html\\|latex\\|example\\|quote\\)") + (end-regexp "^[ \t]*#\\+end_\\(src\\|html\\|latex\\|example\\|quote\\)") + (case-fold-search t) + b e) + (when ad-return-value + (save-excursion + (setq b (re-search-backward begin-regexp nil t)) + (if b (setq e (re-search-forward end-regexp nil t)))) + (if (and b e (< (point) e)) (setq rlt nil))) + (setq ad-return-value rlt))) + +(require 'org) + +;;; Spell check +(add-hook 'org-mode-hook (lambda () (flyspell-mode) (flyspell-buffer))) + +;;; Font sizes +(set-face-attribute 'org-level-1 nil :weight 'bold :height 1.6) +(set-face-attribute 'org-level-2 nil :weight 'bold :height 1.4) +(set-face-attribute 'org-level-3 nil :weight 'bold :height 1.3) +(set-face-attribute 'org-level-4 nil :weight 'normal :slant 'italic :height 1.2) +(set-face-attribute 'org-level-5 nil :weight 'normal :slant 'italic :height 1.15) + +;;; Org agenda +(require 'org-agenda) +(setq org-default-notes-file (concat org-directory "/notes.org")) +(setq org-agenda-files '("~/Documents/org/agenda/")) +(setq org-agenda-custom-commands + '( + ("n" "Agenda and all TODOs" + ((agenda #1="") + (alltodo #1#))) + + ("c" "Custom view" + ((agenda "" + ((org-agenda-sorting-strategy '(category-keep habit-down time-up priority-down)))) + (todo "" + ((org-agenda-sorting-strategy '(category-keep priority-down)))))))) + +;;; Org capture +(setq org-capture-templates + '(("t" "Todo" entry (file+headline "~/Documents/org/agenda/general.org" "Tasks") + "* TODO %?\n %i") + ("h" "Homework" entry (file+headline "~/Documents/org/agenda/uni.org" "Homework") + "* TODO %?\n %i") + ("a" "Assignments" entry (file+headline "~/Documents/org/agenda/uni.org" "Assignments") + "* TODO %?\n %i") + ("c" "Classes/Meetings" entry (file+headline "~/Documents/org/agenda/uni.org" "Classes/Meetings") + "* TODO %?\n %i"))) + +;;; Org roam +(use-package org-roam + :after org + :config + (unless (f-directory-p "~/org-roam") + (make-directory "~/org-roam")) + (setq org-roam-directory (file-truename "~/org-roam") + org-roam-node-display-template + (concat "${title:*} " + (propertize "${tags:25}" 'face 'org-tag))) + (org-roam-db-autosync-mode)) + +;;; Nixos org pdf +(setq org-latex-compiler "lualatex") +(setq org-preview-latex-default-process 'dvisvgm) + +;;; Jupyter +;; (org-babel-do-load-languages +;; 'org-babel-load-languages +;; '((emacs-lisp . t) +;; (julia . t) +;; (python . t) +;; (jupyter . t))) + +;;; Keybinds +(use-package org :after general + :config + (general-define-key :keymaps 'org-mode-map "C-c C-x M-v" "C-c C-x C-v C-c C-x C-v" ) + (general-define-key :keymaps 'org-mode-map "C-c a" 'ispell-word)) + +(provide 'teh-config-org-mode) + +;;; teh-config-org-mode.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config-trust.el b/modules/home-manager/emacs/config/config/teh-config-trust.el new file mode 100644 index 0000000..3bc6f05 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config-trust.el @@ -0,0 +1,12 @@ +;;; teh-config-trust.el --- My config - trusted-content -*- lexical-binding: t; -*- +;;; Commentary: +;;; Manage Emacs 30's `trusted-content' via trust-manager. +;;; Code: + +(use-package trust-manager + :ensure nil ; built by Nix + :config + (trust-manager-mode 1)) + +(provide 'teh-config-trust) +;;; teh-config-trust.el ends here diff --git a/modules/home-manager/emacs/config/config/teh-config.el b/modules/home-manager/emacs/config/config/teh-config.el new file mode 100644 index 0000000..6a3a4a8 --- /dev/null +++ b/modules/home-manager/emacs/config/config/teh-config.el @@ -0,0 +1,40 @@ +;;; teh-config.el --- My config +;;; Commentary: +;;; My config files + +;;; Code: + +;;; Make sure packages work +(require 'package) +(add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/")) +(package-initialize) +(unless package-archive-contents + (package-refresh-contents)) +;; Make sure to run list-packages and update with U every so often +;; use-package is built in; packages Nix provides count as installed, so +;; :ensure only downloads the ones Nix doesn't have +(require 'use-package) +(setq use-package-always-ensure t) + +;;; Require rest of config +(require 'teh-config-general) +(require 'teh-config-auth) +(require 'teh-config-trust) +(require 'teh-config-completion) +(require 'teh-config-erc) +(require 'teh-config-org-mode) +(require 'teh-config-emms) +(require 'teh-config-looks) +(require 'teh-config-keybinds) + +;;; Require random functions +(require 'my-functions) + +;; (let ((frame (make-frame))) +;; (select-frame-set-input-focus frame) +;; (start-scratch)) + +(provide 'teh-config) + +;;; teh-config.el ends here diff --git a/modules/home-manager/emacs/config/gnu.png b/modules/home-manager/emacs/config/gnu.png Binary files differnew file mode 100644 index 0000000..c5404a8 --- /dev/null +++ b/modules/home-manager/emacs/config/gnu.png diff --git a/modules/home-manager/emacs/config/init.el b/modules/home-manager/emacs/config/init.el new file mode 100644 index 0000000..e867704 --- /dev/null +++ b/modules/home-manager/emacs/config/init.el @@ -0,0 +1,23 @@ +;; Emacs init.el +(require 'package) +(add-to-list 'load-path (concat user-emacs-directory "config")) +(add-to-list 'load-path (concat user-emacs-directory "lisp")) +(require 'teh-config) + +;; Customize writes to an untracked file so it stays out of the repo +(setq custom-file (concat user-emacs-directory "custom.el")) +(load custom-file 'noerror) + +(put 'narrow-to-region 'disabled nil) +(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. + '(trust-manager-trust-alist '(("/home/boss/nixos-configuration/")))) +(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. + ) diff --git a/modules/home-manager/emacs/config/lisp/emacs-quotes.txt b/modules/home-manager/emacs/config/lisp/emacs-quotes.txt new file mode 100644 index 0000000..30619eb --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/emacs-quotes.txt @@ -0,0 +1,523 @@ +[1] I don't think anyone is claiming this is an innovation, merely a syntactic atrocity + +[2] dynamic languages are static languages where someone's spamming the "just shut up and compile" button on the compiler + +[3] y'know, if you took the vi out of it, evil would be nothing more than el + +[4] dash was created in a fit of rage upon learning that filter in Common Lisp was named remove-if-not + +[5] so, I'm not completely sure what the function I'm writing does / I'm using examples though, so I think I'm close + +[6] if you are not competent, and you cannot hire someone competent, you should not be on the network + +[7] I dunno what FSF is, but that OS is completely free + +[8] if your users can't turn on the lights even after you tell them to use the switch, and draw a picture of the switch, then they have to work in the dark + +[9] do you just adopt whatever language had the last press release + +[10] The dialect of PHP we use is pretty nice + +[11] C++ is basically php with types + +[12] java got linked to the web as securely as saddam hussein got linked to 9/11 for the war + +[13] Doesn't seem to hard to implement a WYSIWYG Word processor, I just don't see enough interest for it to actually have the work put in + +[14] I haven't quite fully adopted the minimalistic philosophy of the emacser + +[15] bzr is slow compared to glaciers + +[16] lisp is so efficient that a single lisp programmer is as awful as any dozen random java programmers + +[17] Bewildered ignorance is the first step toward halting semi-cluefulness + +[18] People say they want a passion for clean code, but as soon as you punch a guy for using tabs they're all 'wtf dude' + +[19] I'll take "it's possible that it will still break" over "it's not possible that it will not break" any day + +[20] weak typing is where the compiler would rather do something idiotic than declare a type error + +[21] a really good compiler would optimize away the dev + +[22] i'm not a troll. I'm using win xp and emacs + +[23] I don't actually have a problem with either, but putting down one pointless activity in favor of your favored pointless activity is more pointless than the pointless activities we started with + +[24] man.. this new platform HP is creating built out of memristors seems like the perfect environment to run a lisp OS + +[25] We already have a global variable for this. Why add an argument for it + +[26] On the other hand, Perl 6 may be the first software that suffers from bitrot before it's launched, at this rate + +[27] C++ is kind of annoying to work with , because foo_bar(Baz(gloorpFumble(FOO_X, bar::z))) is everywhere + +[28] you could probably get #emacs to argue over toilet seats + +[29] I've given up installing linux on hardware, vbox is fast enough + +[30] The Elisp Intro is probably the best genral compsci intro I've come across with Lisp + +[31] On the x86, you can compute without any instructions at all + +[32] I guess we can do an xml based complex mail transfer protocol + +[33] I hate it when people reject things based on metadata + +[34] elisp is fast when you replace elisp with something actually fast + +[35] Linux is Linux. userland is a passe concept + +[36] javascript is like emacs lisp because it's functional and buffer-oriented + +[37] it's odd the extent to which "antique japanese elisp" is a thing + +[38] I tried Latex and saw that it is better to use HTML + +[39] oh, I don't need piping or reasonable shells + +[40] i think i can say w/o a hint of exaggeration that asm.js is the most exciting piece of technology in the universe + +[41] "markdown" is like four regexp replacements and a lot of wishful thinking + +[42] sometimes the rational choice is to go insane + +[43] eshell was created in a fit of rage when someone realized cmd.exe is the best terminal windows has to offer + +[44] any user's emacs is a unique rube goldberg machine + +[45] If you're going to agree with me, you should really do so in a less disagreeable way. + +[46] video conferencing technology is significantly improved since the 1700s + +[47] My printing is informed by Irish uncials, and my script by copperplate, so I'm all over the place + +[48] rule #1 of optimization: never profile + +[49] usually I just irc until I get banned from 2 or 3 channels then I call it a night + +[50] just wrap the body into (let ((last-command this-command)) ...) + +[51] weird. I was trying to be snarky, but it turns out to be neutral and correct. bummer. + +[52] If I want to talk to nerds using obsolete software, there's uum, IRC + +[53] Operator precedence is a workaround for the problem of having forgotten to make your programming language a lisp. + +[54] I can't upgrade packages because emacs crashes every time I try / so I'm actually okay + +[55] But as I don't know how to do it, it is pointless to describe, what I actually did + +[56] C++ is a better Lisp than Fortran, that's for sure + +[57] I try to avoid getting an overview of what's going on in my emacs. it sounds frightening + +[58] Yes, but how many of these integer things can there actually be? 9? 10 + +[59] C is awesome - you can have a serious security problem because you added two integers the wrong way! + +[60] half of emacsing is guessing at names, it seems + +[61] They couldn't agree on one standard, so they added a configuration option. + +[62] email at least has a spec; blogs just have "various objections to dave winer" + +[63] the way Emacs does things currently is mind-boggingly stupid. That I can work around it does not make it any less stupid. + +[64] We don't resist progress. We have added progress in 1989, and it works perfectly fine. + +[65] Hey wait, I can just grep over the root filesystem and hope the string appears in the binary + +[66] sites like this make me sad because some of the images are incredibly too large for my buffer width + +[67] FSF exists for some reason, and what we say wouldn't have happened if they were not present. + +[68] one can talk about the diff. between python and scheme, but the implementation is the same. + +[69] by the time you've decided the radio buttons are now sliders, you have to update the toolkit anyway, so fuck it, let's just start over + +[70] it's probably stupid that I'm writing elisp with awk right now + +[71] please pick a proper nickname so that /ignore can work reliably on you + +[72] voice recognition systems do seem to be a golden opportunity for people with neither pets nor children to scold an inanimate object + +[73] We have some internet, but it arrives on container ships, so it is often stale by the time it arrives + +[74] rust is basically C with ownership and hipster syntax + +[75] I took a course on type theory and formally studied type inference and I still don't understand that shit. [Haskell] + +[76] How much elisp source code could there possibly be + +[77] i want to give away my cpu for free but I don't like Seti @ Home. Is there like an Emacs @ Home or something + +[78] Hm, I guess I can probably read a bunch of patents and figure out how to make Dove... the patents should have expired by now. + +[79] Ahhh!! You didn't warn me that M-x rmail would delete ALL my mail!!! + +[80] I tried emacs. Basically I was blown away by the fact that you could just type and the chars would appear. + +[81] anyone heard of that Atom browser based editor? they claim it is customizable..i wondered if i could configure it to where it acted like my good ol' emacs does now. then i could have emacs goodness with a shiny new buzzword compliant browser thing + +[82] No one will ever convince me lisp does not follow the unix way unless this sentences is wrong + +[83] blocking during execution of an infinite loop is annoying + +[84] I love that Ruby is 50% designed by the guiding principle of how to make it easy to write an Emacs mode for it. + +[85] I only use latex for one reason, make stuff you write look like you know what you're talking about + +[86] if your fix doesn't have a stupid domain name and a press release, I'm not interested + +[87] "use find-library." / "I am not advanced enough to use such wizardry" + +[88] I could do that but I'd have to learn pointers and a few other things in elisp + +[89] isn't clojure a bunch of extra shit ontop of CL, but using other compilers + +[90] I dont think I really understand anything - I get the impresion I shouldnt be using a computer when I talk on irc + +[91] I think it is well-know that the defaults are not very touch-typing-friendly. I shouldn't have to explain it, really. Like, lifting your hands from the home row and such. + +[92] common lisp is great if your ambition is to be invited to parties by Paul Graham + +[93] first post here, new to irc: how tricky would it be to import the keybindings used on spacemacs for use with Emacs + +[94] Now I use yasnippet, but I'm not quite sure why. + +[95] non-systems languages include c and other standardish high-level languages + +[96] it's significantly quicker when it doesn't hang! + +[97] it realy shouldn't matter if i use defvar or let , the only diff between the two is scope + +[98] when toilets started flushing themselves, I realized that the robot takeover was inevitable. + +[99] At this point, I'm not even interested in what's a good idea technically...I want what's going to play well on HN + +[100] dear redactors, you cannot redact a PDF by drawing black rectangles over the naughty bits. + +[101] He's a fine dude. I like this dude. I don't like what git has done do this dude. + +[102] hopefully it's just a wet keyboard and it'll be working again on monday + +[103] the awful thing about haskell, is how much time i waste trying to make my solution elegant. + +[104] I dream with lisp unification. + +[105] I don't have to visit stackoverflow most of the days! + +[106] isn't there some new self-hosted uber thing + +[107] I suppose I would trust haskell over c++ with keeping my financial records accurately + +[108] Whenever I try to learn more about autotools, I become more conscious that my life is finite. + +[109] sometimes I wonder whether I'm a demigod for being able to type in relevant keywords into a search box + +[110] TypeScript is nice and all, but it shouldn't have added this static typing nonsense. + +[111] self-insert-command has a different side effect for each key you bind it to + +[112] anyway, is your problem fixed? I wasn't really listening. + +[113] oh big fancypants using haskell all up in here + +[114] I still assume that invalid UTF-8 strings were written by people with bad characters. + +[115] Weird, looks like the problem is with loading a 9 meg one-line JSON file. + +[116] Blegh, added a few million newlines and now it loads fine. + +[117] it doesn't have versions, so no one ever makes breaking changes + +[118] the simplest solution is if she doesn't use emacs, break the engagement + +[119] hm, I set nil to t and now I get this message when a helm completion fails + +[120] my son mooned me by using eclipse. Disclaimer: I don't have a son. (any more) + +[121] I relied heavily on C-h a. And I know a thing or two about elisp as well + +[122] I'm not writing SQL, I'm writing pgPL/SQL. + +[123] * bob gives up on sql and turns to C++ / * pat gives up on hemlock and turns to enriched uranium + +[124] "im using spacemacs but not evil" + +[125] "You can only catch Emacs users in their natural habitats" "Basements?" + +[126] i feel like if i take my euler solution in haskell and convert it to python, it is cheating, because haskell allowed me to see the elegant truth. + +[127] oh damnit, the naive sieve of eratosthenes isn't very performant + +[128] Maybe "refactoring" itself is a bad sign. + +[129] I can write a very slow c program. But it'll be slow faster than a slow java program. + +[130] big o notation is just a fancy way of recording how hard a program has to work to execute. and the goal is to kake sure programs do not work harder than they have to. + +[131] I use functional programming, so I never allocate trash + +[132] what's the total time needed to drink the oceans? / good question, I wouldn't say it's not worth calculating + +[133] if i could go back it time i never would have done glue + +[134] is python that good ? I mean why do I use python if I could use C++ + +[135] [elisp] is more difficult than asm + +[136] the world's moving onto vr and 3d and you're worried about your smut being in surround sound + +[137] got a source that isn't wikipedia + +[138] okay! Then I need to know what bytes represent \0 + +[139] You should try a pratt parser. I know it sounds too good to be true, but it'll also cure cancer errectile disfunction and magically teach you a foreign language. + +[140] I thought vim plugins were written in Haskell, no + +[141] <$x> could haskell automagically do this for certain problems? <$y> I have no idea but tempted to say yes anyway + +[142] When my friends asked me to share a report I was working on, I pasted the whole Org buffer into Google docs, set it to landscape and monospace font! + +[143] emacs is lemon-walnut flavored weird with mint + +[144] learning elisp by just reading the reference is far less effective than learning it in anger + +[145] wifi causes brain tumours. At least if you read twitter over wifi + +[146] im just learning about org mode and i need to eat regular meals, so i made a todo list. i missed lunch and now i feel sad. :( + +[147] It could be that c structs are made poorly but I can make a struct in forth that works gr8 + +[148] In addition, the line “Don’t have a cow!” seemed like a direct mockery of Hinduism. + +[149] i keep procastinating telling myself that once i perfect my coding workflow ill actually start to learn coding + +[150] Yeah, but I'm not sure what /whois iqubic would return. + +[151] i don't think package.el gonna be as robust as chrome + +[152] java is like the government, cuz you can't just ring them and ask for a cup of sugar, you have to fill out a lot of paperwork, and the large companies run them + +[153] seems to me the lisp syntax is simple enough for eons of compute time to ignite super ai, other languages like Python, dunnoh + +[154] spacemacs is proof steve jobs is still alive + +[155] fortran is the new lisp. Only it's older. Hm. + +[156] The scripting convienences actually turned me on to Computer Science + +[157] it's probably the most ergonomic web framework there is + +[158] The main reason we don't use plain lambda calculus is it doens't have fast arrays and it doesn't have fast addition subtraction multiplication division + +[159] lambda calculus can not beat the o notation of lists + +[160] I made a subreddit dedicated to my own autism + +[161] gah I can't by the life of me figure out how to add two pointers in c + +[162] also there isn't yet any terminal in emacs that support 16 colors, which makes vim kinda difficult to use + +[163] imagine being named "Bruce Perens" and not becoming a lisp programmer + +[164] what if emacs has built in hacks and rms is secretly compiling a list of who has and does not have proprietary software installed + +[165] I just successfully changed the hostname on my gentoo machine to a emoji top hat + +[166] langton was a little loopy + +[167] Just hoping that software latency decreases now that Moore's law is dying + +[168] Common Lisp at least has tradition and it has substance, it has an idea behind it + +[169] don't you like when you're relatives ask if you used their credit card because there's a weird 100$ debit only to learn later that they gave their credit card to win a phone on some website that said 'Google' + +[170] homogenization of the external surface API of all software through containerization makes the deployment of distributed systems practically programmable + +[171] That awkward moment when "ping www.google.com" works, but I still can't access the internet. + +[172] helm-find-files will not reproduce dired bunnies like traditional dired does + +[173] sometimes I write code exclusively by copy+pasting letters from other places + +[174] soon i will be using emacs from windows 3.1. exciting. noone will take me seriously anymore. + +[175] Taking windows advice from me is like sex tips from the pope + +[176] Elisp is based on MacLisp, what is a 1970s Lisp, so an acousic coupler would be the most appropriate Emacs internet connection available + +[177] one time like a decade ago I hooked up doctor.el to jabber.el + +[178] is fsbot a bot + +[179] please don't comission emacs doujinshi + +[180] well you know how xml is basically a database + +[181] i don't trust people who don't self host a blog + +[182] compiling emacs did a good job of getting the heatsink glue to cure + +[183] id fear git would make my finances publically available.. yea.. i use emacs + ledger to keep track of my budget + +[184] I have a lisper friend who switched to vim specifically in order to help himself waste less time messing around with his config; "vimscript is terrible" as a feature, not a bug + +[185] the point of a screen is to display things. a 16:9 screen can display 10% less than a 16:10 screen. therefore they're 10% worse. qed. + +[186] Hmm, the third highest rated professor at MIT is Stack Overflow. + +[187] I cannot in good conscience upvote this. + +[188] My actual milk is an Excel spreadsheet, and my fridge is a postgres database row with a filename that should point to a created spreadsheet. + +[189] I like dressup in games, but only if I can then walk out of the shop and chop up passing strangers with a katana + +[190] bosses like emails with attachments + +[191] when you're cooking kale, if you cover the pan in cooking oil, it makes it easier to slide the kale into the trash + +[192] i think i want to get more proficient with awk and jq first + +[193] The SPC key and the ~/.spacemacs completely replaced my need to know anything about emacs. + +[194] so I tried that goat simulator last night. The cover art led me to believe it was a spoof of a micromanagement business sim, but in fact it's a spoof of a tony hawks skateboarding game + +[195] NT is a fantastic kernel and much superior to Linux, IMHO. I hope it'll be FOSS one day soon + +[196] omg I opened a page that had an animated gif in eww and it brought my entire machine to a crawl + +[197] i want to make invoices with a pain text database + +[198] i ahve a bigger vocabulary than you + +[199] i copy paste from stackoverflow all the time and so far my pc hasn't died + +[200] the miracle of docker is I should be able to start deploying applications which use emacs as a platform + +[201] then I used Emacs to write Racket to generate SVG for the laser cutter to construct the case + +[202] programming is not a contest how much poo you can throw at the wall + +[203] no clue who Rob Pike is + +[204] when i get an extended vacation i plan on typing out my own init.el + +[205] I am opened to any advice on the name. Although it is not real thread, the usage is 100% thread-like. + +[206] One day, this section will have a link to a nice manual for the Tectonic program. Unfortunately, we haven’t written it yet. + +[207] i still think it is a microsoft plot + +[208] I dislike the idea of Common Lisp, I am more of a RISC kind of person. On the other hand, I bet CL is comfertable like coitus, and I do like to be comfertable as well ... + +[209] When you run a command like 'find . -name "*.java"', don't you wish it were running a lightweight webserver so you could monitor it + +[210] I am not using tiling WMs because I found that the efficiency turned me into a freak. I'd be swapping in and out of programs like 10 times in a second or something + +[211] The public domain is vast and deep. And shark-infested. + +[212] Apple Silicon is great because it's one more giant Intel contract in the dump + +[213] is vim easier than vim, + +[214] in emacs everything is pure, and its loops are good + +[215] you end up with architectures like [this] where the CL program is wearing some Qt program written in another language like RPC lederhosen + +[216] this is a logo that says "your egg is hijacking this plane and flying it to cuba" + +[217] vscode has many more people and many more hours, and iit becomes more perverted and corrupted from day to da; exactly luike atom and remacs + +[218] if you put a troll in the pork futures warehouse he'll figure out how to use emacs real quick + +[219] I don't understand how any nontrivial program in haskell gets shipped in less than a century + +[220] I guess #emacs is simply my friend when I need something + +[221] Oh, sure. I just meant the grammatical issue of "may or may want" (which could be either "may [as in allowed] or may want [as in possibly desire]" or "(may or may) want [ as in a meaningless disjunction along with may as in possibly]"; when I intended to write "may or may not [as in tautologically imply nothing, assuming the law of the excluded middle]) + +[222] "Linux" could run a real risk of this I suppose. like kleenex but for CPUs. + +[223] but but but nonfree wifi firmware interferes with your freedom to go dig in the closet for an ethernet cable + +[224] Common Lisp seems like the worst lisp except for all of the alternatives. You can use Scheme or Fennel as long as you remember to install someone else's standard library all the fucking time. You can use Clojure as long as you have at least 1 TiB of RAM and you don't mind getting a cup of tea while your program starts. You can use, I don't know, Arc? Please come on in, you're the only one here today. + +[225] Most times you don't need to customize a variable. + +[226] Hrm, only one in four black swans is gay + +[227] we should implement a LibreJS-like extension to the SSH protocol, and only connect to servers advertising that they do not use or steer users towards non-free software. + +[228] I want every buffer to look cool. + +[229] checking spelling is one of the hardest problems in computer science + +[230] haskell is nice if you need to stop doing drugs + +[231] i'm always a little surprised when dumb-jump works + +[232] "transpiler" is a technical term meaning "I don't know what a compiler is" + +[233] i'm sure moxie is angry that it exists...which makes me want to use it even more + +[234] matrix is a series of grant deliverables masquerading as a protocol + +[235] why do I need selenium in order to get my latest bank statement? why can't I just curl it like a normal human being + +[236] ohhh you wanted a latte WITHOUT rat shit in it; well you should have been more specific! + +[237] I did not want to screw the default init.el, while I am still fiddling with my_init.el + +[238] I built a keyboard from scratch to work around the many RSI-related shortcomings of conventional keyboards; highly recommended + +[239] i should use mine to amuse myself instead of just multiplicate mattresses + +[240] Okay, its time to learn lisp for real this time. brb in 20 minutes. + +[241] I'm at the point where I literally probably will host an FTP site for completed projects, and just keep git repos on separate machines. public git repos are dumb + +[242] Emacs is so beautiful (: + +[243] For you, it was a crisis of bullshit and controversy; for me, it was tuesday + +[244] rising sea levels counteract rising C levels + +[245] One of my hobbies is messing with the CSS for a website until it looks like a LaTeX article. And then I don't read it because I've already had my fun + +[246] emacs in a resume is always goof + +[247] any performance improvement can be mitigated by adding more code + +[248] i am a greybeard, i only have an ipad, never had need for a phone + +[249] vim is cool, but has a giant downside: it's written in vim + +[250] x became the roman number glyph for ten after romans found out that xemacs is exactly ten times better than emacs + +[251] it just uses more, which is usually less + +[252] I'm switching to mIRC in Windows, as soon as emacs boots Windows 95 + +[253] Quoth the macro, "this isn't even my final form" + +[254] When everyone you meet is a lamer, consider that you might be the lamer. + +[255] it's like a formalistic orthopedic keyboard that forces me to have good posture + +[256] I did not get the tramp I wanted + +[257] I find myself split keyboards are the best, because I have difficulties having hands really close to one another due to pecs being in the way. + +[258] i am 359% more efficient when using palenight with 80% transparency + +[259] I had difficulties even compiling chibi-scheme to webassembly + +[260] well, that's the beauty of the browser. no more issues + +[261] the plural of regex is regrets + +[262] Try moving your laptop closer to their server diff --git a/modules/home-manager/emacs/config/lisp/emacs-says.el b/modules/home-manager/emacs/config/lisp/emacs-says.el new file mode 100644 index 0000000..78e7fc5 --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/emacs-says.el @@ -0,0 +1,47 @@ +;;; emacs-says.el --- Some quotes from #emacs on libera.chat + +;; Author: TehBoss +;; Version: 0.1 + +;;; Commentary: +;; This package provides functions to get some funny quotes +;; Make sure you have emacs-quotes.txt in the same directory as this file + +;;;###autoload +(defvar emacs-says-quotes + nil + "Quotes for `emacs-says-quote`") + +(defcustom emacs-says-default-file + (expand-file-name "emacs-quotes.txt" (file-name-directory load-file-name)) + "Default file for `emacs-says-load-quotes'") + +(defun emacs-says-load-quotes (&optional file) + "Loads the quotes from FILE into the `emacs-says-quotes' variable +If FILE is not specified use `emacs-says-default-file'" + (unless file + (setq file emacs-says-default-file)) + (setq emacs-says-quotes nil) + (save-excursion + (set-buffer (find-file-noselect file)) + (goto-char (point-min)) + (while (re-search-forward "^[^\n]+$" (point-max) 1) + (push (match-string 0) emacs-says-quotes)) + (kill-buffer)) + (setq emacs-says-quotes (reverse emacs-says-quotes))) + +(defun emacs-says-quote (&optional quote) + "Gets a random quote from `emacs-says-quotes' or gives the quote specified by QUOTE" + (interactive) + (if emacs-says-quotes + (progn + (if quote + (setq quote (1- quote)) + (setq quote (random (length emacs-says-quotes)))) + (if (or (>= quote (length emacs-says-quotes)) (<= quote -1)) + (message "Quote value too high or too low") + (message (nth quote emacs-says-quotes))) + (nth quote emacs-says-quotes)) + (message "Emacs quotes not loaded, use `emacs-says-load-quotes'"))) + +(provide 'emacs-says) diff --git a/modules/home-manager/emacs/config/lisp/erc-sasl.el b/modules/home-manager/emacs/config/lisp/erc-sasl.el new file mode 100644 index 0000000..e376259 --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/erc-sasl.el @@ -0,0 +1,95 @@ +;; erc-sasl.el -- handle SASL PLAIN authentication + +;; Copyright (C) 2012 Joseph Gay + +;; Author: Joseph Gay <ysph@psy.ai> +;; Keywords: comm + +;; This file is NOT part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This file implements SASL PLAIN authentication +;; To activate: +;; +;; (require 'erc-sasl) +;; +;; (add-to-list 'erc-sasl-server-regexp-list "host\\.server\\.com") +;; e.g. irc\\.freenode\\.net, or .* for any host +;; +;; To disable: +;; (setq erc-sasl-use-sasl nil) +;; +;; NOTE: requires passing a password initially to (erc) and variants + +;;; Code: + +(eval-when-compile (require 'cl)) + +(defvar erc-sasl-use-sasl t + "Set to nil to disable SASL auth") + +(defvar erc-sasl-server-regexp-list '() + "List of regexps matching server host names for which sasl + should be used") + +(defun erc-sasl-use-sasl-p () + "Used internally to decide whether SASL should be used in the +current session" + (and erc-sasl-use-sasl + (boundp 'erc-session-server) + (cl-loop for re in erc-sasl-server-regexp-list + thereis (integerp (string-match re erc-session-server))))) + +(define-erc-response-handler (CAP) + "Client capability framework is used to request SASL auth, need + to wait for ACK to begin" nil + (let ((msg (erc-response.contents parsed))) + (when (string-match " *sasl" msg) + (erc-server-send "AUTHENTICATE PLAIN") + ;; now wait for AUTHENTICATE + + ))) + +(define-erc-response-handler (AUTHENTICATE) + "Handling empty server response indicating ready to receive + authentication." nil + (if erc-session-password + (let ((msg (erc-response.contents parsed))) + (when (string= "+" msg) + ;; plain auth + (erc-server-send + (format "AUTHENTICATE %s" + (base64-encode-string + (concat "\0" (erc-current-nick) + "\0" erc-session-password) t))))) + (progn + (erc-display-message + parsed 'error + (if erc-server-connected 'active proc) + "You must set a password in order to use SASL authentication.") + ;; aborting SASL auth + (erc-server-send (erc-server-send "AUTHENTICATE *"))))) + +(define-erc-response-handler (903) + "Handling a successful SASL authentication." nil + (erc-server-send "CAP END")) + +(provide 'erc-sasl) + +;;; erc-sasl.el ends here +;; Local Variables: +;; indent-tabs-mode: nil +;; End: diff --git a/modules/home-manager/emacs/config/lisp/insert-date.el b/modules/home-manager/emacs/config/lisp/insert-date.el new file mode 100644 index 0000000..ca8214f --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/insert-date.el @@ -0,0 +1,21 @@ +;;; package --- insert-date.el +;;; commentary: +;;; Package to insert a date + +;;; CODE: + +(defcustom insert-date-format + "%m-%d-%Y" + "Format for the `insert-date' function." + :type '(string) + :group 'insert-date) + +(defun insert-date () + "Insert the date into the curret buffer. +Format can be changed with `insert-date-format'." + (interactive) + (insert (format-time-string insert-date-format (current-time)))) + +(provide 'insert-date) + +;;; insert-date.el ends here diff --git a/modules/home-manager/emacs/config/lisp/jabber-bookmark-jump.el b/modules/home-manager/emacs/config/lisp/jabber-bookmark-jump.el new file mode 100644 index 0000000..686ec47 --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/jabber-bookmark-jump.el @@ -0,0 +1,27 @@ +;;; package --- jabber.el +;;; commentary: +;;; not really sure how i'm supposed to format this + + +;;; CODE: + +(defun jabber-bookmark-jump (bookmark) + "Opens muc bookmark BOOKMARK." + (interactive (list (completing-read "Bookmark: " + (let ((acc (fsm-get-state-data (jabber-read-account))) + (names)) + (dolist (elem + (gethash (plist-get acc :original-jid) jabber-bookmarks)) + (setq names (cons (list (cdr (car (nth 1 elem)))) names))) + names)))) + (let ((acc (fsm-get-state-data (jabber-read-account))) + (nick)) + (dolist (elem + (gethash (plist-get acc :original-jid) jabber-bookmarks)) + (if (equal (cdr (car (nth 1 elem))) bookmark) + (setq nick (nth 2 (nth 2 elem))))) + (jabber-muc-join (jabber-read-account) bookmark nick t))) + +(provide 'jabber-bookmark-jump) + +;;; jabber-bookmark-jump.el ends here diff --git a/modules/home-manager/emacs/config/lisp/my-functions.el b/modules/home-manager/emacs/config/lisp/my-functions.el new file mode 100644 index 0000000..52bb72d --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/my-functions.el @@ -0,0 +1,48 @@ +;;; my-functions.el --- My random functions +;;; Commentary: +;;; Some random functions + +;;; Code: + +;;; Karate +(defun karate-new (timestamp) + "Creates new document for karate lesson plans based on a template." + (interactive + (list (org-read-date nil t))) + (let ((date (format-time-string "%d-%m-%Y" timestamp))) + (copy-file "~/Documents/karate/lessonPlans/default.org" + (concat "~/Documents/karate/lessonPlans/" date ".org") 1) + (switch-to-buffer (find-file-noselect (concat "~/Documents/karate/lessonPlans/" date ".org"))) + (replace-string "DATEHERE" date) + (goto-char (point-min)) + (forward-line 5) + (end-of-line))) + +;;; Scratch +(defun start-scratch () + "Function to call when starting the scratch window, or to enter scratchpad mode." + (interactive) + ;; Make window not transparent + (set-frame-parameter (selected-frame) 'alpha '(100 100)) + ;; Make change WM_NAME to "scratch-emacs" + (set-frame-parameter (selected-frame) 'name "scratch-emacs") + (org-agenda nil "n") + (delete-other-windows) + ) +(defun stop-scratch () + "Function to call to stop the scratch window." + (interactive) + ;; Make window transparent + (set-frame-parameter (selected-frame) 'alpha '(80 80)) + (set-frame-parameter (selected-frame) 'name nil)) + +;;; Terminal +(require 'multi-vterm) +(defun start-terminal () + "Function to call to start a terminal and switch to insert mode, usually used for the keybind $mod+Shift+Return." + (interactive) + (multi-vterm)) + +(provide 'my-functions) + +;;; my-functions.el ends here diff --git a/modules/home-manager/emacs/config/lisp/notif.wav b/modules/home-manager/emacs/config/lisp/notif.wav Binary files differnew file mode 100644 index 0000000..592532e --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/notif.wav diff --git a/modules/home-manager/emacs/config/lisp/qalc.el b/modules/home-manager/emacs/config/lisp/qalc.el new file mode 100644 index 0000000..8f344ed --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/qalc.el @@ -0,0 +1,64 @@ +(defvar qalc-cli-file-path "" + "Path to the program used by `run-qalc'") + +(defvar qalc-cli-arguments '() + "Commandline arguments to pass to `qalc-cli'.") + +(defvar qalc-mode-map + (let ((map (nconc (make-sparse-keymap) comint-mode-map))) + ;; example definition + (define-key map "\t" 'completion-at-point) + map) + "Basic mode map for `run-qalc'.") + +(defvar qalc-prompt-regexp "^\\(?:>\\)" + "Prompt for `run-qalc'.") + +(defvar qalc-buffer-name "*Qalc*" + "Name of the buffer to use for the `run-qalc' comint instance.") + +(defun run-qalc () + "Run an inferior instance of `qalc-cli' inside Emacs." + (interactive) + (let* ((qalc-program (executable-find "qalc")) + (buffer (get-buffer-create qalc-buffer-name)) + (proc-alive (comint-check-proc buffer)) + (process (get-buffer-process buffer))) + ;; if the process is dead then re-create the process and reset the + ;; mode. + (unless proc-alive + (with-current-buffer buffer + (apply 'make-comint-in-buffer "Qalc" buffer + qalc-program '() qalc-cli-arguments) + (qalc-mode))) + ;; Regardless, provided we have a valid buffer, we pop to it. + (when buffer + (pop-to-buffer buffer)))) + +(defun qalc--initialize () + "Helper function to initialize Qalc." + (setq comint-process-echoes nil) + (setq comint-use-prompt-regexp t) + (setq comint-prompt-read-only t) + (add-hook 'comint-preoutput-filter-functions 'comint-set-text-read-only)) + + +(defun comint-set-text-read-only (text) + (propertize text 'read-only t)) + +(add-hook 'qalc-mode-hook 'qalc--initialize) + +(define-derived-mode qalc-mode comint-mode "Qalc" + "Major mode for `run-qalc'. + +\\<qalc-mode-map>" + ;; this sets up the prompt so it matches > + (setq comint-prompt-regexp qalc-prompt-regexp) + ;; this makes it read only; a contentious subject as some prefer the + ;; buffer to be overwritable. + (setq comint-prompt-read-only t) + ;; this makes it so commands like M-{ and M-} work. + (set (make-local-variable 'paragraph-separate) "\\'") + (set (make-local-variable 'paragraph-start) qalc-prompt-regexp)) + +(provide 'qalc) diff --git a/modules/home-manager/emacs/config/lisp/timer.el b/modules/home-manager/emacs/config/lisp/timer.el new file mode 100644 index 0000000..359fe28 --- /dev/null +++ b/modules/home-manager/emacs/config/lisp/timer.el @@ -0,0 +1,25 @@ +;;; timer.el - Sends you a notification after a certain time + +(defun timer-do-alert (title body) + "Uses `message' and `notifications-notify' to send an alert" + (message (format "%s - %s" title body)) + (notifications-notify :title title :body body)) + +(defun timer-alert (delay body) + "Sends an alert after DELAY containing the message BODY." + (interactive "sDelay: \nsBody: ") + (let (seconds minutes hours num-string) + (dolist (char (delete "" (split-string "3s" ""))) + (if (seq-contains-p (delete "" (split-string "0123456789" "")) char) + (setq num-string (concat num-string char)) + (progn (cond ((equal char "s") (setq seconds (string-to-number num-string))) + ((equal char "m") (setq minutes (string-to-number num-string))) + ((equal char "h") (setq hours (string-to-number num-string)))) + (setq num-string "")))) + (unless seconds + (setq seconds 0)) + (unless minutes + (setq minutes 0)) + (unless hours + (setq hours 0)) + (run-at-time (format "%s sec %s min %s hour" seconds minutes hours) nil 'timer-do-alert "Emacs alert" body))) |
