Compare commits

...
4 Commits
Author SHA1 Message Date
tim.mccarthy 1e497a9bca Fix misc errors 2026-09-09 12:09:05 -07:00
tim.mccarthy a9255c2fea Fix language mode configs 2026-09-09 12:08:38 -07:00
tim.mccarthy f7df3af685 Deferred loading for avy and explain-pause-mode 2026-09-09 12:08:13 -07:00
tim.mccarthy 3869fc71d6 Disable Jinx 2026-09-09 12:07:26 -07:00
+33 -36
View File
@@ -213,7 +213,6 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
:map lisp-interaction-mode-map
("C-j" . nil))
:demand t
:config
(defun avy-action-embark (pt)
(unwind-protect
@@ -284,12 +283,12 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
;;;; Jinx
(use-package jinx
:ensure t
:hook (emacs-startup . global-jinx-mode)
:custom
(jinx-modes '(text-mode))
:bind ([remap transpose-chars] . jinx-correct))
;; (use-package jinx
;; :ensure t
;; :hook (emacs-startup . global-jinx-mode)
;; :custom
;; (jinx-modes '(text-mode))
;; :bind ([remap transpose-chars] . jinx-correct))
;;; Completion
;;;; Vertico
@@ -678,7 +677,8 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
;;;; Explain-pause
(use-package explain-pause-mode
:ensure (:host github :repo "lastquestion/explain-pause-mode"))
:ensure (:host github :repo "lastquestion/explain-pause-mode")
:commands explain-pause-mode)
;;;; Reveal-in-finder
(defun first-executable (candidates)
@@ -741,7 +741,6 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(org-special-ctrl-a/e 'reversed)
(org-hide-emphasis-markers t)
(org-use-speed-commands t)
(add-to-list 'org-speed-commands '("h" . org-fold-hide-sublevels))
(org-use-fast-todo-selection 'expert)
(org-todo-keywords '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)")))
(org-use-property-inheritance '("STYLE"))
@@ -751,12 +750,20 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
((agenda "" ((org-agenda-span 1)))
(todo "TODO" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline))))))))
:config
(add-to-list 'org-speed-commands '("h" . org-fold-hide-sublevels))
(defun my/org-agenda-today ()
"Show org agenda for today only."
(interactive)
(org-agenda nil "d"))
(add-hook 'org-after-todo-state-change-hook #'org-save-all-org-buffers))
(defun my/org-save-current-buffer ()
"Save the current Org file, including when editing an indirect buffer."
(with-current-buffer (or (buffer-base-buffer) (current-buffer))
(when (and buffer-file-name (buffer-modified-p))
(save-buffer))))
(add-hook 'org-after-todo-state-change-hook #'my/org-save-current-buffer))
(use-package org-agenda
:bind (:map org-agenda-mode-map
@@ -767,8 +774,7 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
;; Preload org-mode (and warm up text-mode hooks like jinx) after
;; packages are available on the load-path
;; Preload Org and its mode hooks after packages are available.
(add-hook 'emacs-startup-hook
(lambda ()
(with-temp-buffer
@@ -777,9 +783,9 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(defun my/org-clear-all ()
(interactive)
(let ((ast (org-element-parse-buffer))
;; Temporarily disable org-save-all-org-buffers
;; Save only once after all TODO states have been cleared.
(org-after-todo-state-change-hook
(remove #'org-save-all-org-buffers
(remove #'my/org-save-current-buffer
org-after-todo-state-change-hook)))
;; Iterate over all headlines in the parsed AST
(org-element-map ast 'headline
@@ -789,7 +795,7 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(goto-char (org-element-property :begin hl))
(org-todo ""))))
;; Save once at the end
(org-save-all-org-buffers)))
(my/org-save-current-buffer)))
;;;; Screenshots for games
;; Steps to set up:
@@ -856,10 +862,18 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(use-package treesit-auto
:ensure t
:custom
;; Check and offer to install these grammars once at startup.
(treesit-auto-langs '(bash css dockerfile html javascript json python rust
tsx typescript yaml))
(treesit-auto-install 'prompt)
:hook (prog-mode . treesit-auto-mode)
:config
(treesit-auto-add-to-auto-mode-alist 'all))
;; Use treesit-auto for grammar recipes, without its per-file scanning.
(global-treesit-auto-mode -1)
(treesit-auto-install-all)
(setq major-mode-remap-alist
(treesit-auto--build-major-mode-remap-alist))
;; Register only modes whose grammars are available.
(treesit-auto-add-to-auto-mode-alist))
;;;; Markdown
(use-package markdown-mode
@@ -880,22 +894,11 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(keymap-global-set "C-c o r" #'copy-source-for-reddit)
;;;; YAML
(use-package yaml-mode
:ensure t)
;;;;
;;;; CSV
(use-package csv-mode
:ensure t)
;;;; Rust
(use-package rust-mode
:ensure t)
;;;; Python
(setq major-mode-remap-alist
'((python-mode . python-ts-mode)))
(use-package lsp-pyright
:ensure t
:custom (lsp-pyright-langserver-command "basedpyright")
@@ -906,10 +909,6 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(setq lsp-pylsp-plugins-flake8-ignore '("D100" "D101" "D102"))
;;;; Docker
(use-package dockerfile-mode
:ensure t)
;;;; LSP
(use-package lsp-mode
:ensure t
@@ -992,8 +991,6 @@ EMACS-ALTERNATIVE is the Emacs equivalent (e.g., 'C-s')."
(use-package svelte-mode
:ensure t)
(use-package typescript-mode
:ensure t)
;;; Eshell
;;;; Eshell
(require 'cl-lib)
@@ -1154,7 +1151,7 @@ any directory proffered by `consult-dir'."
eshell-prompt-regexp eshell-p10k-prompt-string))
(use-package eshell-syntax-highlighting
:after eshell-mode
:after esh-mode
:ensure t
:config
(eshell-syntax-highlighting-global-mode +1))