Compare commits

...
5 Commits
Author SHA1 Message Date
JosephFerano 69af07dc49 emacs: require org? 2026-05-11 13:22:02 +07:00
JosephFerano 017c4b0b7d emacs: guard against missing gptel keys 2026-05-11 13:19:52 +07:00
JosephFerano 77b1b6f999 emacs: comment out dotenv 2026-05-11 13:14:37 +07:00
JosephFerano 5c4d83590c emacs: centaur tabs package 2026-05-11 13:10:11 +07:00
JosephFerano a949d2b57b emacs: C-x b 2026-05-11 13:07:22 +07:00
+23 -17
View File
@@ -205,6 +205,7 @@ Finish up
all-the-icons-completion all-the-icons-completion
;; eat ;; eat
;; Enhancements ;; Enhancements
centaur-tabs
olivetti olivetti
helpful helpful
vterm vterm
@@ -1020,10 +1021,7 @@ Fill region is great, except when you don't need it...
(require 'all-the-icons-ibuffer) (require 'all-the-icons-ibuffer)
(add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode) (add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode)
(global-set-key [remap list-buffers] 'ibuffer) (global-set-key [remap list-buffers] 'ibuffer)
(evil-define-key '(normal insert visual emacs) 'global (global-set-key (kbd "C-x b") #'consult-buffer)
(kbd "C-b") #'consult-buffer)
(evil-define-key '(normal insert visual emacs) 'global
(kbd "C-S-b") #'ibuffer)
(defun joe/switch-other-buffer () (defun joe/switch-other-buffer ()
"Switch to other buffer" "Switch to other buffer"
@@ -2179,19 +2177,26 @@ start it, so go through all existing buffers that match the mode and belong to t
#+end_src #+end_src
** AI ** AI
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq gptel-default-mode #'org-mode)
(setq gptel-api-key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string)))
(gptel-make-openai "ChatGPT" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(setq gptel-model 'claude-sonnet-4-6) (defun joe/read-file-or-nil (filename)
(setq gptel-backend (gptel-get-backend "Claude")) "Read FILENAME from emacs directory, return nil if file doesn't exist."
(let ((path (expand-file-name filename user-emacs-directory)))
(when (file-exists-p path)
(with-temp-buffer
(insert-file-contents path)
(string-trim (buffer-string))))))
(setq gptel-default-mode #'org-mode)
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(setq gptel-api-key gpt-key))
(when-let ((claude-key (joe/read-file-or-nil "gptel-key")))
(gptel-make-anthropic "Claude" :stream t :key claude-key)
(setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude")))
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(gptel-make-openai "ChatGPT" :stream t :key gpt-key))
(setq gptel-prompt-prefix-alist '((markdown-mode . "### ") (setq gptel-prompt-prefix-alist '((markdown-mode . "### ")
(org-mode . "* ") (org-mode . "* ")
@@ -2425,7 +2430,7 @@ it doesn't close it.
(deactivate-mark)))) (deactivate-mark))))
;; This is required so that .dir-locals that read env files for credentials works ;; This is required so that .dir-locals that read env files for credentials works
(require 'dotenv) ;; (require 'dotenv)
(defun joe/sql-mode-hook () (defun joe/sql-mode-hook ()
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun) (define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
(define-key sql-mode-map (kbd "C-M-x") #'sql-send-pg-function) (define-key sql-mode-map (kbd "C-M-x") #'sql-send-pg-function)
@@ -2505,6 +2510,7 @@ Apparently this helps with the performance of dape, as well as LSP
** org-mode ** org-mode
*** General *** General
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'org)
(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG"))) (setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG")))
(setq org-directory "~/Notes/") (setq org-directory "~/Notes/")