diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index 5206ce5..8324905 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -12,8 +12,7 @@ '(c-label-minimum-indentation 0) '(c-label-offset -4) '(clojure-build-tool-files - '("project.clj" "build.boot" "build.gradle" "build.gradle.kts" "deps.edn" - "shadow-cljs.edn" "TARGETS")) + '("project.clj" "build.boot" "build.gradle" "build.gradle.kts" "deps.edn" "shadow-cljs.edn" "TARGETS")) '(comint-input-ignoredups t) '(comint-prompt-read-only t) '(comint-scroll-to-bottom-on-input t) @@ -64,33 +63,35 @@ bazel blacken cider clang-format clipetty clojure-mode color-theme-monokai color-theme-sanityinc-solarized color-theme-sanityinc-tomorrow company company-jedi - company-lsp compat cquery dap-mode dap-netcore - dash-functional deadgrep dockerfile-mode doom-themes - earthfile-mode editorconfig eglot eglot-java elm-mode esup - exec-path-from-shell filladapt fish-mode flycheck - flycheck-elm flycheck-rust flymake flyspell fsharp-mode - geiser gnu-elpa-keyring-update go-autocomplete go-mode - gptel graphviz-dot-mode hack-mode haxe-mode howm ink-mode + company-lsp compat cquery dash-functional deadgrep + dockerfile-mode doom-themes earthfile-mode editorconfig + eglot eglot-java elm-mode esup exec-path-from-shell + filladapt fish-mode flycheck flycheck-elm flycheck-rust + flymake flyspell fsharp-mode geiser + gnu-elpa-keyring-update go-autocomplete go-mode gptel + graphviz-dot-mode hack-mode haxe-mode howm ink-mode js2-mode js2-refactor json-mode jsonnet-mode lsp-hack lsp-pyright lsp-ui lua-mode magit markdown-mode merlin mocha modus-themes monky monokai-theme multi-term mustache-mode nyan-mode paredit popup prettier-js - projectile protobuf-mode python-mode request rjsx-mode ruby-mode - rust-mode scala-ts-mode sql-indent swift-mode - switch-window terraform-mode thrift tide tree-sitter tss - tuareg typescript-mode use-package vterm web-mode wgrep - wgsl-mode xref-js2 xterm-color yaml-mode zig-mode)) + projectile protobuf-mode python-mode request rjsx-mode + ruby-mode rust-mode scala-mode scala-ts-mode sql-indent + swift-mode switch-window terraform-mode thrift tide + tree-sitter tss tuareg typescript-mode use-package vterm + web-mode wgrep xref-js2 xterm-color yaml-mode zig-mode)) '(reb-re-syntax 'string) '(rmail-mail-new-frame t) '(safe-local-variable-values '((docker-image-name . "onceandfuture") - (eval ignore-errors - "Write-contents-functions is a buffer-local alternative to before-save-hook" + (eval ignore-errors "Write-contents-functions is a buffer-local alternative to before-save-hook" (add-hook 'write-contents-functions - (lambda nil (delete-trailing-whitespace) nil)) + (lambda nil + (delete-trailing-whitespace) + nil)) (require 'whitespace) "Sometimes the mode needs to be toggled off and on." - (whitespace-mode 0) (whitespace-mode 1)) + (whitespace-mode 0) + (whitespace-mode 1)) (whitespace-line-column . 80) (whitespace-style face trailing lines-tail) (require-final-newline . t))) '(scala-indent:use-javadoc-style t) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9ab86f6..128dca4 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -870,10 +870,7 @@ Or, uh, Objective C, I guess." ("/\\(?:WORKSPACE\\(?:\\.bazel\\)?\\)\\'" . bazel-workspace-mode) ("/\\(?:BUILD\\(?:\\.bazel\\)?\\)\\'" . bazel-build-mode) ("/.+\\.tilt\\'" . bazel-starlark-mode) - ("/Tiltfile$" . bazel-starlark-mode) - ("BUCK" . bazel-build-mode) - ("/..bxl\\'" . bazel-starlark-mode) - )) + ("/Tiltfile$" . bazel-starlark-mode))) (defun my/open-bazel-build () "Open the build.bazel file that dominates this source file." @@ -1405,20 +1402,17 @@ Do this when you edit your project view." ;; AI Shit ;; ================================================================= (defun claude-get-api-key () - "Get Claude API key from ~/.config/io.datasette.llm/keys.json file." - (let* ((keys-file (expand-file-name "~/.config/io.datasette.llm/keys.json")) - (json-object-type 'hash-table) - (json-array-type 'list) - (json-key-type 'string)) - (if (file-exists-p keys-file) - (let* ((json-data (with-temp-buffer - (insert-file-contents keys-file) - (json-read-from-string (buffer-string)))) - (claude-key (gethash "claude" json-data))) - (if claude-key - claude-key - (error "Claude API key not found in keys.json"))) - (error "Key file keys.json file not found at %s" keys-file)))) + "Get Claude API key from auth-source." + (let ((auth-info (nth 0 (auth-source-search :host "anthropic.com" + :user "claude-api" + :require '(:secret) + :create t)))) + (if auth-info + (let ((secret (plist-get auth-info :secret))) + (if (functionp secret) + (funcall secret) + secret)) + (error "Claude API key not found in auth-source")))) (use-package gptel :ensure :config @@ -1427,19 +1421,4 @@ Do this when you edit your project view." gptel-backend (gptel-make-anthropic "Claude" :stream t :key #'claude-get-api-key)) ) - -;; ================================================================= -;; Debugging -;; ================================================================= -(use-package dap-mode :ensure - :commands dap-debug - :config - (require 'dap-netcore)) - -;; ================================================================= -;; WGSL -;; ================================================================= -(use-package wgsl-mode :ensure - :mode "\\.wgsl\\'") - ;;; init.el ends here