Updates on my side for THWAP change tests

This commit is contained in:
William Moore 2024-07-11 10:05:04 -05:00
parent e09db8864e
commit a9769e9919
7 changed files with 90 additions and 91 deletions

6
.gitignore vendored
View File

@ -1,6 +1,12 @@
*~ *~
*.elc *.elc
elpa/
melpa/
*.lock
.org-id-locations
org-roam.db
scratch scratch
.emacs.desktop
recentf recentf
.cache* .cache*
.lsp* .lsp*

19
init.el
View File

@ -4,21 +4,22 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(desktop-save-mode t)
'(mouse-autoselect-window t) '(mouse-autoselect-window t)
'(mouse-drag-and-drop-region t) '(mouse-drag-and-drop-region t)
'(mouse-drag-and-drop-region-cross-program t) '(mouse-drag-and-drop-region-cross-program t)
'(terraform-format-on-save t) '(thwap-development '(magitmode projectilemode pythonmode elpymode yamlmode))
'(terraform-indent-level 2) '(thwap-orgmode '(orgmode orgdownload orgroam orgpublish))
'(thwap-ui-theme nil)
'(tool-bar-mode nil) '(tool-bar-mode nil)
'(visible-bell 1) '(visible-bell 1))
'(xterm-mouse-mode t))
(custom-set-faces ;;(custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(default ((t (:family "Noto Sans Mono" :foundry "GOOG" :slant normal :weight regular :height 90 :width normal))))) ;; '(default ((t (:family "Noto Sans Mono" :foundry "GOOG" :slant normal :weight regular :height 90 :width normal)))))
;; thwap helpers ;; thwap helpers
(require 'thwap-helpers) (require 'thwap-helpers)
@ -43,3 +44,9 @@
(let ((user-config (thwap/list-files-with-extension "~/.emacs.d/thwap.d" "el"))) (let ((user-config (thwap/list-files-with-extension "~/.emacs.d/thwap.d" "el")))
(dolist (config user-config) (dolist (config user-config)
(load-file config))) (load-file config)))
(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.
)

View File

@ -4,9 +4,9 @@
;; ;;
;; automatically revert buffers when they change on disk ;; automatically revert buffers when they change on disk
(global-auto-revert-mode t) ;; (global-auto-revert-mode f)
;; display line numbers, TODO make this a config option for line number style ;; display line numbers, TODO make this a config option for line number style
(global-display-line-numbers-mode 1) ;; (global-display-line-numbers-mode 1)
;; set our default warning level to error ;; set our default warning level to error
(setq warning-minimum-level :error) (setq warning-minimum-level :error)
;; set the default tab width to 2 spaces ;; set the default tab width to 2 spaces
@ -25,10 +25,10 @@
;; ;;
;; golden-ratio ;; golden-ratio
(straight-use-package 'golden-ratio) ;; (straight-use-package 'golden-ratio)
(golden-ratio-mode 1) ;; (golden-ratio-mode 1)
(setq golden-ratio-auto-scale t) ;; (setq golden-ratio-auto-scale t)
(message "Golden Ratio Mode Enabled") ;; (message "Golden Ratio Mode Enabled")
;; ;;
;; Set up the T.H.W.A.P. keybindings ;; Set up the T.H.W.A.P. keybindings

View File

@ -10,11 +10,9 @@
(const :tag "lsp" lspmode) ;; generally required for other modes (const :tag "lsp" lspmode) ;; generally required for other modes
(const :tag "magit" magitmode) ;; git integration (const :tag "magit" magitmode) ;; git integration
(const :tag "projectile" projectilemode) ;; project management (const :tag "projectile" projectilemode) ;; project management
(const :tag "copilot" copilotmode) ;; code completion
(const :tag "go" gomode) ;; go language support (const :tag "go" gomode) ;; go language support
(const :tag "python" pythonmode) ;; python language support (const :tag "python" pythonmode) ;; python language support
(const :tag "elpy" elpymode) ;; python language support (elpy) (const :tag "elpy" elpymode) ;; python language support (elpy)
(const :tag "terraform" terraformmode) ;; terraform language support
(const :tag "yaml" yamlmode)) ;; yaml language support (const :tag "yaml" yamlmode)) ;; yaml language support
:group 'thwap-config) :group 'thwap-config)
@ -49,19 +47,6 @@
(thwap/add-key-binding "p" 'projectile-command-map "Projectile commands") (thwap/add-key-binding "p" 'projectile-command-map "Projectile commands")
(message "projectile loaded")) (message "projectile loaded"))
;; co-pilot
(when (memq 'copilotmode thwap-development)
(straight-use-package 'dash)
(straight-use-package 'editorconfig)
(use-package copilot
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
:ensure t)
;; you can utilize :map :hook and :config to customize copilot
(add-hook 'prog-mode-hook 'copilot-mode)
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
(message "copilot loaded"))
;; go-mode ;; go-mode
(when (memq 'gomode thwap-development) (when (memq 'gomode thwap-development)
(straight-use-package 'go-mode) (straight-use-package 'go-mode)
@ -96,16 +81,6 @@
:hook (python-mode . python-black-on-save-mode)) :hook (python-mode . python-black-on-save-mode))
(message "python-mode loaded")) (message "python-mode loaded"))
;; terraform-mode
(when (memq 'terraformmode thwap-development)
(straight-use-package 'terraform-mode)
(when (eq 'company thwap-completion)
(straight-use-package 'company-terraform)
(add-hook 'terraform-mode-hook #'company-terraform-init))
(add-hook 'terraform-mode-hook #'terraform-format-on-save-mode)
(add-hook 'terraform-mode-hook #'terraform-format-on-save-mode)
(message "terraform-mode loaded"))
;; yaml-mode ;; yaml-mode
(when (memq 'yamlmode thwap-development) (when (memq 'yamlmode thwap-development)
(straight-use-package 'yaml-mode) (straight-use-package 'yaml-mode)

View File

@ -60,10 +60,10 @@ LST is reversed and concatenated into a single string with line breaks."
"Update the `org-agenda-files` variable. "Update the `org-agenda-files` variable.
This function sets `org-agenda-files` and `org-timeblock-files` to the list of This function sets `org-agenda-files` and `org-timeblock-files` to the list of
all `.org` files in the `~/.org-agenda` directory, and sets all `.org` files in the `~/.org-agenda` directory, and sets
`org-timeblock-inbox-file` to `~/.org-agenda/tasks.org`." `org-timeblock-inbox-file` to `~/org/agenda/index.org`."
(setq org-agenda-files (thwap/list-files-with-extension "~/.org-agenda" "org")) (setq org-agenda-files (thwap/list-files-with-extension "~/org/agenda" "org"))
(setq org-timeblock-files (thwap/list-files-with-extension "~/.org-agenda" "org")) (setq org-timeblock-files (thwap/list-files-with-extension "~/org/agenda" "org"))
(setq org-timeblock-inbox-file "~/.org-agenda/tasks.org")) (setq org-timeblock-inbox-file "~/org/agenda/index.org"))
(message "T.H.W.A.P. Loaded helper function library.") (message "T.H.W.A.P. Loaded helper function library.")

View File

@ -10,11 +10,12 @@
(const :tag "Doom themes" doomthemes) (const :tag "Doom themes" doomthemes)
(const :tag "Sublime themes" sublimethemes) (const :tag "Sublime themes" sublimethemes)
(const :tag "Kaolin themes" kaolinthemes) (const :tag "Kaolin themes" kaolinthemes)
(const :tag "Alect themes" alectthemes)) (const :tag "Alect themes" alectthemes)
(const :tag "Wombat themes" wombat))
:group 'thwap-config) :group 'thwap-config)
;; theme to load ;; theme to load
(defcustom thwap-ui-theme 'wombat ;; 'modus-vivendi-tinted (defcustom thwap-ui-theme nil
"Name of the theme to load." "Name of the theme to load."
:type 'string :type 'string
:group 'thwap-config) :group 'thwap-config)
@ -28,7 +29,7 @@
:group 'thwap-config) :group 'thwap-config)
;; theme bits ; theme bits
(when (memq 'modusthemes thwap-ui-themes) (when (memq 'modusthemes thwap-ui-themes)
(straight-use-package 'modus-themes) (straight-use-package 'modus-themes)
@ -50,16 +51,21 @@
(require 'kaolin-themes) (require 'kaolin-themes)
(message "Kaolin themes loaded.")) (message "Kaolin themes loaded."))
(when (memq 'alectthems thwap-ui-themes) (when (memq 'alectthemes thwap-ui-themes)
(straight-use-package 'alect-themes) (straight-use-package 'alect-themes)
(require 'alect-themes) (require 'alect-themes)
(message "Alect themes loaded.")) (message "Alect themes loaded."))
;; load the theme specified in the config (when (memq 'wombat thwap-ui-themes)
'(thwap-ui-theme 'wombat)
(message "Wombat themes loaded."))
;; load the theme specified in the config if it is set
;; if things look wonky, you probably either need to install the ;; if things look wonky, you probably either need to install the
;; theme or you need to check your spelling. ;; theme or you need to check your spelling.
(load-theme thwap-ui-theme :no-confirm) (if thwap-ui-theme
(message "Theme loaded: %s" thwap-ui-theme) (load-theme thwap-ui-theme :no-confirm)
(message "Theme loaded: %s" thwap-ui-theme))
;; icon bits ;; icon bits

View File

@ -11,7 +11,9 @@
(const :tag "Org-Modern" orgmodern) (const :tag "Org-Modern" orgmodern)
(const :tag "Org-TimeBlock" orgtimeblock) (const :tag "Org-TimeBlock" orgtimeblock)
(const :tag "Org-Download" orgdownload) (const :tag "Org-Download" orgdownload)
(const :tag "Org-Transclusion" orgtransclusion)) (const :tag "Org-Transclusion" orgtransclusion)
(const :tag "Org-Roam" orgroam)
(const :tag "Org-Publish" orgpublish))
:group 'thwap-config) :group 'thwap-config)
;; org-babel extras ;; org-babel extras
@ -21,11 +23,6 @@
(const :tag "ob-napkin" obnapkin)) (const :tag "ob-napkin" obnapkin))
:group 'thwap-config) :group 'thwap-config)
(defcustom thwap-org-openai-api-token nil
"OpenAI API Token for use in org-ai. (Setting this enables the org-ai support.)"
:type 'string
:group 'thwap-config)
;; ;;
;; Ensure Org mode is installed and loaded ;; Ensure Org mode is installed and loaded
;; ;;
@ -33,15 +30,15 @@
;; base ;; base
(when (memq 'orgmode thwap-orgmode) (when (memq 'orgmode thwap-orgmode)
(straight-use-package 'org) (straight-use-package 'org)
(thwap/ensure-directory-exists "~/.org-agenda") (thwap/ensure-directory-exists "~/org")
(setq browse-url-browser-function 'browse-url-generic (setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox-esr" browse-url-generic-program "firefox-esr"
org-log-done 'time org-log-done 'time
org-startup-indented t org-startup-indented t
org-hide-leading-stars t org-hide-leading-stars t
org-support-shift-select t org-support-shift-select t
org-directory "~/.org-agenda" org-directory "~/org"
org-default-notes-file "~/.org-agenda/notes.org" org-default-notes-file "~/org/index.org"
org-export-with-sub-superscripts t org-export-with-sub-superscripts t
org-export-with-toc t) org-export-with-toc t)
(thwap/org-agenda-files-update) (thwap/org-agenda-files-update)
@ -49,19 +46,19 @@
'((sequence "TODO(t)" "WAITING(w)" "BLOCKED(b)" "|" "IN-PROGRESS(i)") '((sequence "TODO(t)" "WAITING(w)" "BLOCKED(b)" "|" "IN-PROGRESS(i)")
(sequence "WONTDO(o)" "DEPRECATED(e)" "STUPID(s)" "|" "DONE(d)"))) (sequence "WONTDO(o)" "DEPRECATED(e)" "STUPID(s)" "|" "DONE(d)")))
(setq org-capture-templates (setq org-capture-templates
`(("t" "TODO" entry (file+headline "~/.org-agenda/tasks.org" "Tasks") `(("t" "TODO" entry (file+headline "~/org/agenda/index.org" "Tasks")
"* TODO %?\n %a") "* TODO %?\n %a")
("l" "TODO" entry (file+headline "~/.org-agenda/tasks.org" "LIFE Tasks") ("l" "TODO" entry (file+headline "~/org/agenda/index.org" "LIFE Tasks")
"* TODO %?\n %i\n %a") "* TODO %?\n %i\n %a")
("a" "Appointment" entry (file+headline "~/.org-agenda/events.org" "Appointments") ("a" "Appointment" entry (file+headline "~/org/agenda/events.org" "Appointments")
"* %?\n %i\n %a" :clock-in t :clock-resume t) "* %?\n %i\n %a" :clock-in t :clock-resume t)
("e" "Schedule Event" entry (file+headline "~/.org-agenda/events.org" "Events") ("e" "Schedule Event" entry (file+headline "~/org/agenda/events.org" "Events")
"* %?\n %i\n %a" :clock-in t :clock-resume t) "* %?\n %i\n %a" :clock-in t :clock-resume t)
("m" "Schedule Meeting" entry (file+headline "~/.org-agenda/events.org" "Meetings") ("m" "Schedule Meeting" entry (file+headline "~/org/agenda/events.org" "Meetings")
"* %?\n %i\n %a" :clock-in t :clock-resume t) "* %?\n %i\n %a" :clock-in t :clock-resume t)
("n" "Note" entry (file "~/.org-agenda/notes.org") ("n" "Note" entry (file "~/org/index.org")
"* %?\n %i\n %a" :clock-in t :clock-resume t) "* %?\n %i\n %a" :clock-in t :clock-resume t)
("i" "Idea" entry (file "~/.org-agenda/ideas.org") ("i" "Idea" entry (file "~/org/agenda/ideas.org")
"* %? :IDEA: \n%t" :clock-in t :clock-resume t))) "* %? :IDEA: \n%t" :clock-in t :clock-resume t)))
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
@ -113,17 +110,38 @@
(message "org-download loaded")) (message "org-download loaded"))
;; org-roam ;; org-roam
;; (when (and thwap-org-enable-org thwap-org-enable-org-roam) (when (and (memq 'orgmode thwap-orgmode) (memq 'orgroam thwap-orgmode))
;; (setq org-roam-directory "~/.org-agenda") (straight-use-package 'org-roam)
;; (setq org-roam-db-location "~/.org-agenda/org-roam.db") (org-roam-db-autosync-mode)
;; (setq org-roam-completion-everywhere t) (setq org-roam-v2-ack t)
;; (setq org-roam-capture-templates (setq org-roam-directory "~/org-roam")
;; '(("d" "default" plain "%?" (setq org-roam-db-location "~/org-roam/org-roam.db")
;; :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") (setq org-roam-completion-everywhere t)
;; :unnarrowed t))) (setq org-roam-capture-templates
;; (add-hook 'after-init-hook 'org-roam-mode) '(("d" "default" plain "%?"
;; (add-hook 'org-mode-hook 'org-roam-mode) :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
;; (add-hook 'org-mode-hook 'org-roam-ui-mode)) :unnarrowed t)))
;; (add-hook 'after-init-hook 'org-roam)
;; (add-hook 'org-mode-hook 'org-roam)
;;(add-hook 'org-mode-hook 'org-roam-ui-mode)
)
(when (and (memq 'orgmode thwap-orgmode) (memq 'orgpublish thwap-orgmode))
(require 'ox-publish)
(setq org-publish-project-alist
'(
("org-notes"
:base-directory "~/org/"
:base-extension "org"
:publishing-directory "~/www/html/org/"
:recursive t
:publishing-function org-html-publish-to-html
:headline-levels 4 ; Just the default for this project.
:auto-preamble t
)
))
)
;; ;; org-roam-ui ;; ;; org-roam-ui
;; (when (and thwap-org-enable-org thwap-org-enable-org-roam thwap-org-enable-org-roam-ui) ;; (when (and thwap-org-enable-org thwap-org-enable-org-roam thwap-org-enable-org-roam-ui)
@ -144,19 +162,6 @@
(add-to-list 'org-babel-load-languages '(mermaid . t)) (add-to-list 'org-babel-load-languages '(mermaid . t))
(message "ob-mermaid loaded")) (message "ob-mermaid loaded"))
;; org-ai
(when (and (memq 'orgmode thwap-orgmode) thwap-org-openai-api-token)
(straight-use-package
'(org-ai :type git :host github :repo "rksm/org-ai"
:local-repo "org-ai"
:files ("*.el" "README.md" "snippets")))
(setq org-ai-default-chat-model "gpt-3.5-turbo")
(setq org-ai-openai-api-token thwap-org-openai-api-token)
(org-ai-global-mode)
(org-ai-install-yasnippets)
(message "org-ai loaded"))
(message "T.H.W.A.P. Org-Mode settings loaded") (message "T.H.W.A.P. Org-Mode settings loaded")
(provide 'thwap-orgmode) (provide 'thwap-orgmode)
;; thwap-orgmode.el ends here ;; thwap-orgmode.el ends here