From 8f6d19a189a6392e43e80357445b9819b0e63e90 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 20 Feb 2023 19:12:08 +0000 Subject: [PATCH] doom emacs stuff --- doom/.config/doom/config.el | 63 ++++++++++++---- doom/.config/doom/init.el | 9 ++- doom/.config/doom/lisp/chatgpt.el | 6 +- doom/.config/doom/lisp/oxycarbon.el | 111 ++++++++++++++++++++++++++++ doom/.config/doom/packages.el | 5 +- 5 files changed, 173 insertions(+), 21 deletions(-) create mode 100644 doom/.config/doom/lisp/oxycarbon.el diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el index 98752ae..0b0a8c8 100644 --- a/doom/.config/doom/config.el +++ b/doom/.config/doom/config.el @@ -67,6 +67,7 @@ (add-hook! '+doom-dashboard-functions :append (insert "\n" (+doom-dashboard--center +doom-dashboard--width "The UwU Editor"))) +;; (defun my-weebery-is-always-greater () (let* ((banner '("⣿⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⢀⣾⡿⠋⠉⠁⢠⣿⠏⢁⣿⣿⣿⠏⠉⢸⣿⡏⠉⢻⣿⣿⡇⠈⠙⢿⣿⣿⣿⣷⡆⠀⠀⢇⠢⣈⡒⡤" "⣿⣿⣿⣿⣿⣏⣴⡇⠀⠀⠀⢠⡿⠋⠀⠀⠀⣰⣿⠋⠀⣼⣿⣿⠏⠀⠀⡾⣿⠁⠀⠀⣿⣿⣷⠀⠀⠀⠹⣿⣿⣿⣿⣄⢀⣿⣷⣿⣶⣶" @@ -113,7 +114,7 @@ ;undo fix (setq undo-tree-enable-undo-in-region nil) -(setq undo-limit 80000000) +(setq undo-limit 8000000000) (org-babel-do-load-languages @@ -162,21 +163,57 @@ ;; chatgpt stuff -;;(use-package! chatgpt -;; :defer t -;; :config -;; (unless (boundp 'python-interpreter) -;; (defvaralias 'python-interpreter 'python-shell-interpreter)) -;; (setq chatgpt-repo-path (expand-file-name "straight/repos/ChatGPT.el/" doom-local-dir)) -;; (set-popup-rule! (regexp-quote "*ChatGPT*") -;; :side 'bottom :size .5 :ttl nil :quit t :modeline nil) -;; :bind ("C-c q" . chatgpt-query)) - - -(load! "lisp/chatgpt.el") +(use-package! chatgpt + :defer t + :config + (unless (boundp 'python-interpreter) + (defvaralias 'python-interpreter 'python-shell-interpreter)) + (setq chatgpt-repo-path (expand-file-name "straight/repos/ChatGPT.el/" doom-local-dir)) + (set-popup-rule! (regexp-quote "*ChatGPT*") + :side 'bottom :size .5 :ttl nil :quit t :modeline nil) + :bind ("C-c q" . chatgpt-query)) +;;count the frame-list + + +;;discord rich presence +(require 'elcord) +(add-hook 'doom-switch-buffer-hook + (lambda () + (if (string= (buffer-name) "*doom*") + (elcord-mode -1) + (elcord-mode 1)))) + +(defun elcord--disable-elcord-if-no-frames (f) + (declare (ignore f)) + (when (let ((frames (delete f (visible-frame-list)))) + (or (null frames) + (and (null (cdr frames)) + (eq (car frames) terminal-frame)))) + (elcord-mode -1) + (add-hook 'after-make-frame-functions 'elcord--enable-on-frame-created))) + + (defun elcord--enable-on-frame-created (f) + (declare (ignore f)) + (elcord-mode +1)) + + (defun my/elcord-mode-hook () + (if elcord-mode + (add-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames) + (remove-hook 'delete-frame-functions 'elcord--disable-elcord-if-no-frames))) + + (add-hook 'elcord-mode-hook 'my/elcord-mode-hook) + +(setq warning-minimum-level :emergency) + + +;;(add-hook 'doom-switch-buffer-hook +;; (lambda () +;; (if (string= (buffer-name) "*doom*") +;; (elcord-mode -1) +;; (elcord-mode 1)))) ;; Here are some additional functions/macros that could help you configure Doom: ;; diff --git a/doom/.config/doom/init.el b/doom/.config/doom/init.el index c4d3451..2d2a7a6 100644 --- a/doom/.config/doom/init.el +++ b/doom/.config/doom/init.el @@ -21,9 +21,9 @@ :completion (company +childframe) ; the ultimate code completion backend - ;;helm ; the *other* search engine for love and life + ;;(helm +fuzzy) ; the *other* search engine for love and life ;;ido ; the other *other* search engine... - ;;ivy ; a search engine for love and life + ;;(ivy +fuzzy) ; a search engine for love and life vertico ; the search engine of the future :ui @@ -90,6 +90,7 @@ ;;docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs + ;;biblio ; Writes a PhD for you (citation needed) (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation @@ -97,7 +98,7 @@ magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds - ;;pdf ; pdf enhancements + pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects @@ -170,7 +171,7 @@ ;;web ; the tubes ;;yaml ; JSON, but readable ;;zig ; C, but simpler -:w:email + :w:email ;;(mu4e +org +gmail) ;;notmuch ;;(wanderlust +gmail) diff --git a/doom/.config/doom/lisp/chatgpt.el b/doom/.config/doom/lisp/chatgpt.el index 74bbf26..1460667 100644 --- a/doom/.config/doom/lisp/chatgpt.el +++ b/doom/.config/doom/lisp/chatgpt.el @@ -1,4 +1,4 @@ -;;; ../../dotfiles/doom/.config/doom/lisp/chatgpt.el -*- lexical-binding: t; -*- +;;; chatgpt.el --- Simple ChatGPT frontend for Emacs -*- lexical-binding: t -*- ;; Copyright (C) Gavin Jaeger-Freeborn @@ -151,6 +151,7 @@ It then displays the results in a separate buffer `chatgpt-buffer'." ;;;###autoload (defun chatgpt-prompt-region-and-replace (BEG END) "Replace region from BEG to END with the response from the ChatGPT API. + The region is BEG and until END" (interactive "r") @@ -192,6 +193,7 @@ The region is BEG and until END" (defun chatgpt--query-open-api (prompt callback) "Send a string PROMPT to OpenAI API and pass the resulting buffer to CALLBACK. The environment variable OPENAI_API_KEY is used as your API key + You can register an account here https://beta.openai.com/docs/introduction/key-concepts" (let* ((api-key (getenv "OPENAI_API_KEY")) @@ -215,4 +217,4 @@ you have the correctly set the OPENAI_API_KEY variable" (list callback)))) (provide 'chatgpt) -;;; chatgpt.el ends here +;;; chatgpt.el ends here \ No newline at end of file diff --git a/doom/.config/doom/lisp/oxycarbon.el b/doom/.config/doom/lisp/oxycarbon.el new file mode 100644 index 0000000..e5bc3f5 --- /dev/null +++ b/doom/.config/doom/lisp/oxycarbon.el @@ -0,0 +1,111 @@ + +(autothemer-deftheme oxocarbon "A port of oxocarbon" + + ;; Specify the color classes used by the theme + ((((class color) (min-colors #xFFFFFF)) + ((class color) (min-colors #xFF))) + + ;; Specify the color palette, color columns correspond to each of the classes above. + (oxocarbon-bg "#161616") + (oxocarbon-fg "#f2f4f8") + + (oxocarbon-base00 "#161616") + (oxocarbon-base01 "#262626") + (oxocarbon-base02 "#393939") + (oxocarbon-base03 "#525252") + + (oxocarbon-base04 "#dde1e6") + (oxocarbon-base05 "#f2f4f8") + (oxocarbon-base06 "#ffffff") + (oxocarbon-base07 "#08bdba") + (oxocarbon-base08 "#3ddbd9") + (oxocarbon-base09 "#78a9ff") + (oxocarbon-base10 "#ee5396") + (oxocarbon-base11 "#33b1ff") + (oxocarbon-base12 "#ff7eb6") + (oxocarbon-base13 "#42be65") + (oxocarbon-base14 "#be95ff") + (oxocarbon-base15 "#82cfff")) + + ;; Specifications for Emacs faces. + ;; Simpler than deftheme, just specify a face name and + ;; a plist of face definitions (nested for :underline, :box etc.) + ( + (default (:foreground oxocarbon-fg :background oxocarbon-bg)) ;; background and foreground + (button (:foreground oxocarbon-fg :background oxocarbon-base01)) + ;; (counsel--mark-ring-highlight) + + ;; Programming ;; + (font-lock-string-face (:foreground oxocarbon-base14)) ;; strings + (font-lock-keyword-face (:foreground oxocarbon-base09)) ;; keywords + (font-lock-type-face (:foreground oxocarbon-base09)) ;; variable types + (font-lock-variable-name-face (:foreground oxocarbon-base04)) ;; variable names + (font-lock-comment-face (:foreground oxocarbon-base03)) ;; comments + (font-lock-builtin-face (:foreground oxocarbon-base12)) ;; builtin functions + (font-lock-constant-face (:foreground oxocarbon-base14)) ;; constants + (font-lock-function-name-face (:foreground oxocarbon-base08)) ;; function names + (font-lock-preprocessor-face (:foreground oxocarbon-base09)) + (font-lock-doc-face (:foreground oxocarbon-base14)) + + (corfu-current (:background oxocarbon-base02 :foreground oxocarbon-base08)) + + ;; END ;; + + ;; General ;; + (error (:foreground oxocarbon-base10)) + (warning (:foreground oxocarbon-base13)) + ;; END ;; + + ;; UI ;; + (region (:background oxocarbon-base02)) ;; selction background + (highlight (:background oxocarbon-base02)) ;; highlight when hovering over a link etc. + + (mode-line (:foreground oxocarbon-fg :background oxocarbon-bg)) ;; modeline + (mode-line-inactive (:foreground oxocarbon-fg :background oxocarbon-bg)) + + (line-number-current-line (:foreground oxocarbon-base04 :background oxocarbon-base00)) ;; the current line num + (line-number (:foreground oxocarbon-base02)) ;; line numbers + + ;; parens + (show-paren-match (:background oxocarbon-base02)) ;; matching parens + (show-paren-mismatch (:background oxocarbon-base11)) ;; mismatching parens + + ;; isearch + (isearch-fail (:background oxocarbon-base10)) + + ;; ivy + (ivy-current-match (:background oxocarbon-base02 :foreground oxocarbon-base08)) + (ivy-minibuffer-match-face-1 (:foreground oxocarbon-base08)) + (ivy-minibuffer-match-face-2 (:foreground oxocarbon-base08)) + (ivy-minibuffer-match-face-3 (:foreground oxocarbon-base08)) + (ivy-minibuffer-match-face-4 (:foreground oxocarbon-base08)) + ;; END ;; + + + ) + + + ;; (custom-theme-set-variables 'oxocarbon + ;; `(ansi-color-names-vector [ + ;; ,oxocarbon-base00 + ;; ,oxocarbon-base01 + ;; ,oxocarbon-base02 + ;; ,oxocarbon-base03 + ;; ,oxocarbon-base04 + ;; ,oxocarbon-base05 + ;; ,oxocarbon-base06 + ;; ,oxocarbon-base07 + ;; ,oxocarbon-base08 + ;; ,oxocarbon-base09 + ;; ,oxocarbon-base10 + ;; ,oxocarbon-base11 + ;; ,oxocarbon-base12 + ;; ,oxocarbon-base13 + ;; ,oxocarbon-base14 + ;; ,oxocarbon-base15 + ;; ])) + + + ) + +(provide-theme 'oxocarbon) ;; theme ends here diff --git a/doom/.config/doom/packages.el b/doom/.config/doom/packages.el index a3267f9..1196547 100644 --- a/doom/.config/doom/packages.el +++ b/doom/.config/doom/packages.el @@ -48,6 +48,7 @@ ;(unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;(unpin! t) +(package! elcord) (package! fill-column-indicator) (package! rainbow-mode) (package! poly-org) @@ -56,8 +57,8 @@ :recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist"))) (package! highlight-indent-guides) (package! yuck-mode) -;;(package! chatgpt -;; :recipe (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el"))) +(package! chatgpt + :recipe (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el"))) (package! nasm-mode :pin "65ca6546fc395711fac5b3b4299e76c2303d43a8") (package! haxor-mode :pin "6fa25a8e6b6a59481bc0354c2fe1e0ed53cbdc91")