This commit is contained in:
Joe Frikker
2026-07-02 15:19:56 -04:00
parent 69f3fa445b
commit 1c379cc4a3
3 changed files with 131 additions and 65 deletions
+62 -3
View File
@@ -166,7 +166,7 @@ These are the other programs I have installed globally. A few (like ~awscli~, ~m
are still Redbook-specific; ideally I'd find another way to install them.
#+BEGIN_SRC nix :tangle target/redbook/other-packages.nix
{pkgs, kube, ...}:
{pkgs, ...}:
{
home.packages = with pkgs; [
postgresql
@@ -728,9 +728,10 @@ Actually, nix *really* requires ~bash~. This is a plugin that allows using zsh f
** Claude Code
#+BEGIN_SRC nix :tangle target/base/claude-code.nix
{
{claude-code, ...}: {
programs.claude-code = {
enable = true;
package = claude-code;
};
}
#+END_SRC
@@ -1197,12 +1198,21 @@ Just "silently" wrap when searching at the bottom of a document.
#+BEGIN_SRC elisp
(bufferlo-mode)
(setopt bufferlo-include-buried-buffers nil)
(with-eval-after-load 'bufferlo
(setq mode-line-misc-info
(assq-delete-all 'bufferlo-mode mode-line-misc-info)))
(defun my/bury-or-kill-buffer ()
(interactive)
(bury-buffer)
(bufferlo-kill-orphan-buffers))
(bind-keys
("s-b" . bufferlo-switch-to-buffer))
("s-b" . bufferlo-switch-to-buffer)
("C-x t 0" . bufferlo-tab-close-kill-buffers)
("C-x k" . my/bury-or-kill-buffer))
#+END_SRC
** Language Support
@@ -1216,6 +1226,7 @@ Just "silently" wrap when searching at the bottom of a document.
enable = true;
extraPackages = epkgs: with epkgs; [
consult-eglot
graphql-ts-mode
haskell-ts-mode
jenkinsfile-mode
jq-mode
@@ -1335,6 +1346,10 @@ available? It seems to work for now anyway...
(advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun))
#+end_src
#+BEGIN_SRC elisp
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
#+END_SRC
*** Flymake
#+begin_src elisp
(autoload 'flymake-show-project-diagnostics "flymake")
@@ -1406,6 +1421,7 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
(setopt lispy-compat '(god-mode edebug))
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
(add-hook 'lisp-mode-hook (lambda () (lispy-mode 1)))
(add-hook 'lisp-data-mode-hook (lambda () (lispy-mode 1)))
;; (with-eval-after-load 'lispy
;; (require 'lispyville)
;; (add-hook 'lispy-mode-hook #'lispyville-mode)
@@ -1437,6 +1453,49 @@ for completion. That makes it really annoying to use; don't use yasnippet with e
`(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") grand-parent typescript-ts-mode-indent-offset)))))
(advice-add 'tsx-ts-mode--indent-compatibility-b893426 :override #'my-tsx-ts-mode--indent-compatibility-b893426))
(defvar my/edit-indirect-tag-modes
'(("graphql" . graphql-ts-mode)
("gql" . graphql-ts-mode)
("sql" . sql-mode)
("css" . css-mode))
"Map of tagged-template tag names to major modes.")
(defun my/edit-indirect--node-bounds (node)
"Return (BEG . END) for NODE's contents, excluding delimiters."
(cons (1+ (treesit-node-start node))
(1- (treesit-node-end node))))
(defun my/edit-indirect-tagged-template-at-point ()
(interactive)
(let* ((node (treesit-node-at (point)))
(tmpl-node (treesit-parent-until
node
(lambda (n) (equal (treesit-node-type n) "template_string"))))
(str-node (unless tmpl-node
(treesit-parent-until
node
(lambda (n) (equal (treesit-node-type n) "string")))))
(target-node (or tmpl-node str-node)))
(unless target-node
(user-error "Point is not inside a string or template literal"))
(let* ((tagged-node (and tmpl-node (treesit-node-parent tmpl-node)))
(tag-node (and tagged-node
(equal (treesit-node-type tagged-node) "call_expression")
(treesit-node-child-by-field-name tagged-node "function")))
(tag-name (and tag-node (treesit-node-text tag-node t)))
(mode (cond
(tag-name (or (cdr (assoc tag-name my/edit-indirect-tag-modes))
major-mode))
(t 'text-mode)))
(bounds (my/edit-indirect--node-bounds target-node))
(buf (edit-indirect-region (car bounds) (cdr bounds) t)))
(with-current-buffer buf
(funcall mode)))))
(with-eval-after-load 'typescript-ts-mode
(define-key typescript-ts-mode-map (kbd "C-c '") #'my/edit-indirect-tagged-template-at-point)
(define-key tsx-ts-mode-map (kbd "C-c '") #'my/edit-indirect-tagged-template-at-point))
#+END_SRC
*** Java