doom emacs stuff

This commit is contained in:
Zastian Pretorius
2023-02-20 19:12:08 +00:00
parent 47362df969
commit 8f6d19a189
5 changed files with 173 additions and 21 deletions

View File

@@ -67,6 +67,7 @@
(add-hook! '+doom-dashboard-functions :append (add-hook! '+doom-dashboard-functions :append
(insert "\n" (+doom-dashboard--center +doom-dashboard--width "The UwU Editor"))) (insert "\n" (+doom-dashboard--center +doom-dashboard--width "The UwU Editor")))
;;
(defun my-weebery-is-always-greater () (defun my-weebery-is-always-greater ()
(let* ((banner '("⣿⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⢀⣾⡿⠋⠉⠁⢠⣿⠏⢁⣿⣿⣿⠏⠉⢸⣿⡏⠉⢻⣿⣿⡇⠈⠙⢿⣿⣿⣿⣷⡆⠀⠀⢇⠢⣈⡒⡤" (let* ((banner '("⣿⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⠀⢀⣾⡿⠋⠉⠁⢠⣿⠏⢁⣿⣿⣿⠏⠉⢸⣿⡏⠉⢻⣿⣿⡇⠈⠙⢿⣿⣿⣿⣷⡆⠀⠀⢇⠢⣈⡒⡤"
"⣿⣿⣿⣿⣿⣏⣴⡇⠀⠀⠀⢠⡿⠋⠀⠀⠀⣰⣿⠋⠀⣼⣿⣿⠏⠀⠀⡾⣿⠁⠀⠀⣿⣿⣷⠀⠀⠀⠹⣿⣿⣿⣿⣄⢀⣿⣷⣿⣶⣶" "⣿⣿⣿⣿⣿⣏⣴⡇⠀⠀⠀⢠⡿⠋⠀⠀⠀⣰⣿⠋⠀⣼⣿⣿⠏⠀⠀⡾⣿⠁⠀⠀⣿⣿⣷⠀⠀⠀⠹⣿⣿⣿⣿⣄⢀⣿⣷⣿⣶⣶"
@@ -113,7 +114,7 @@
;undo fix ;undo fix
(setq undo-tree-enable-undo-in-region nil) (setq undo-tree-enable-undo-in-region nil)
(setq undo-limit 80000000) (setq undo-limit 8000000000)
(org-babel-do-load-languages (org-babel-do-load-languages
@@ -162,21 +163,57 @@
;; chatgpt stuff ;; chatgpt stuff
;;(use-package! chatgpt (use-package! chatgpt
;; :defer t :defer t
;; :config :config
;; (unless (boundp 'python-interpreter) (unless (boundp 'python-interpreter)
;; (defvaralias 'python-interpreter 'python-shell-interpreter)) (defvaralias 'python-interpreter 'python-shell-interpreter))
;; (setq chatgpt-repo-path (expand-file-name "straight/repos/ChatGPT.el/" doom-local-dir)) (setq chatgpt-repo-path (expand-file-name "straight/repos/ChatGPT.el/" doom-local-dir))
;; (set-popup-rule! (regexp-quote "*ChatGPT*") (set-popup-rule! (regexp-quote "*ChatGPT*")
;; :side 'bottom :size .5 :ttl nil :quit t :modeline nil) :side 'bottom :size .5 :ttl nil :quit t :modeline nil)
;; :bind ("C-c q" . chatgpt-query)) :bind ("C-c q" . chatgpt-query))
(load! "lisp/chatgpt.el")
;;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: ;; Here are some additional functions/macros that could help you configure Doom:
;; ;;

View File

@@ -21,9 +21,9 @@
:completion :completion
(company +childframe) ; the ultimate code completion backend (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... ;;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 vertico ; the search engine of the future
:ui :ui
@@ -90,6 +90,7 @@
;;docker ;;docker
;;editorconfig ; let someone else argue about tabs vs spaces ;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs ;;ein ; tame Jupyter notebooks with emacs
;;biblio ; Writes a PhD for you (citation needed)
(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists ;;gist ; interacting with github gists
lookup ; navigate your code and its documentation lookup ; navigate your code and its documentation
@@ -97,7 +98,7 @@
magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs ;;make ; run make tasks from Emacs
;;pass ; password manager for nerds ;;pass ; password manager for nerds
;;pdf ; pdf enhancements pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders ;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings ;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects ;;taskrunner ; taskrunner for all your projects
@@ -170,7 +171,7 @@
;;web ; the tubes ;;web ; the tubes
;;yaml ; JSON, but readable ;;yaml ; JSON, but readable
;;zig ; C, but simpler ;;zig ; C, but simpler
:w:email :w:email
;;(mu4e +org +gmail) ;;(mu4e +org +gmail)
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)

View File

@@ -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 ;; Copyright (C) Gavin Jaeger-Freeborn
@@ -151,6 +151,7 @@ It then displays the results in a separate buffer `chatgpt-buffer'."
;;;###autoload ;;;###autoload
(defun chatgpt-prompt-region-and-replace (BEG END) (defun chatgpt-prompt-region-and-replace (BEG END)
"Replace region from BEG to END with the response from the ChatGPT API. "Replace region from BEG to END with the response from the ChatGPT API.
The region is BEG and until END" The region is BEG and until END"
(interactive "r") (interactive "r")
@@ -192,6 +193,7 @@ The region is BEG and until END"
(defun chatgpt--query-open-api (prompt callback) (defun chatgpt--query-open-api (prompt callback)
"Send a string PROMPT to OpenAI API and pass the resulting buffer to 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 The environment variable OPENAI_API_KEY is used as your API key
You can register an account here You can register an account here
https://beta.openai.com/docs/introduction/key-concepts" https://beta.openai.com/docs/introduction/key-concepts"
(let* ((api-key (getenv "OPENAI_API_KEY")) (let* ((api-key (getenv "OPENAI_API_KEY"))
@@ -215,4 +217,4 @@ you have the correctly set the OPENAI_API_KEY variable"
(list callback)))) (list callback))))
(provide 'chatgpt) (provide 'chatgpt)
;;; chatgpt.el ends here ;;; chatgpt.el ends here

View File

@@ -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

View File

@@ -48,6 +48,7 @@
;(unpin! pinned-package another-pinned-package) ;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t) ;(unpin! t)
(package! elcord)
(package! fill-column-indicator) (package! fill-column-indicator)
(package! rainbow-mode) (package! rainbow-mode)
(package! poly-org) (package! poly-org)
@@ -56,8 +57,8 @@
:recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist"))) :recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))
(package! highlight-indent-guides) (package! highlight-indent-guides)
(package! yuck-mode) (package! yuck-mode)
;;(package! chatgpt (package! chatgpt
;; :recipe (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el"))) :recipe (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el")))
(package! nasm-mode :pin "65ca6546fc395711fac5b3b4299e76c2303d43a8") (package! nasm-mode :pin "65ca6546fc395711fac5b3b4299e76c2303d43a8")
(package! haxor-mode :pin "6fa25a8e6b6a59481bc0354c2fe1e0ed53cbdc91") (package! haxor-mode :pin "6fa25a8e6b6a59481bc0354c2fe1e0ed53cbdc91")