gave up on meow / god mode, just using ';' now

This commit is contained in:
2026-07-30 19:06:14 +02:00
parent 977e0e7690
commit 93ff4a2e36
19 changed files with 1385 additions and 448 deletions
+10
View File
@@ -27,3 +27,13 @@ When INCLUSIVE is non-nil, include the character at the end point."
(interactive)
(my/avy-region 'avy-goto-line)
(forward-line 1))
(defun my/another-select-exact-string (str)
"Prompt for a string and select its exact match using avy."
(interactive "sSelect target: ")
(avy-with my/select-exact-string
(avy-jump (regexp-quote str)
:action (lambda (pt)
(goto-char pt)
(set-mark pt)
(forward-char (length str))))))
+1 -1
View File
@@ -10,7 +10,7 @@
;; Faces for distinction
(defface buffer-table-open '((t :inherit font-lock-keyword-face :bold t)) "Face for open files.")
(defface buffer-table-recent '((t :inherit shadow)) "Face for recent closed files.")
(defface buffer-table-special '((t :inherit font-lock-comment-face)) "Face for internal buffers.")
(defface buffer-table-special '((t :inherit font-lock-string-face)) "Face for internal buffers.")
(defface buffer-table-modified '((t :inherit error :bold t)) "Face for modified flag.")
(defface buffer-table-marked '((t :inherit warning :bold t)) "Face for marked entries.")
Binary file not shown.
-130
View File
@@ -1,130 +0,0 @@
;;; ../../lyfi/configs/apps/doom/custom/meow.el -*- lexical-binding: t; -*-
;;Custom Meow Cheatsheet Renderer
(defvar my-meow-board-grid
'(("1" "2" "3" "4" "5" "6" "7" "8" "9" "0")
("q" "w" "e" "r" "t" "y" "u" "i" "o" "p")
("a" "s" "d" "f" "g" "h" "j" "k" "l" ";")
("z" "x" "c" "v" "b" "n" "m" "," "." "/" "'"))
"The physical layout of the board as a 2D array.")
(defun my-meow-get-cmd-name (key)
"Helper to get the short name of a command for a given key, or a placeholder."
(let ((cmd (key-binding key)))
(if cmd
(meow--short-command-name cmd)
(if (member key '("TAB" "SFT" "CTL" "CAPS" "GUI" "ALT" "MO1" "SPC" "ENT" "BKSL" "LMB" "RMB" "UP" "DN" "N2"))
key
"<not bound>"))))
(defun my-meow-render-grid ()
"Generates a clean table of Meow commands with base and shift layers."
(let ((output ""))
(dolist (row my-meow-board-grid)
(let ((row-lower "")
(row-upper ""))
(dolist (key row)
(let* ((low-name (my-meow-get-cmd-name key))
(up-key (upcase key))
(up-name (my-meow-get-cmd-name up-key)))
;; Build the lower layer string
(setq row-lower (concat row-lower
(format "[%s = %-12s] " key low-name)))
;; Build the upper layer string
(setq row-upper (concat row-upper
(format "[%s = %-12s] " up-key up-name)))))
;; Append both layers, then a newline for a gap between physical rows
(setq output (concat output row-lower "\n" row-upper "\n\n"))))
output))
(defun my-meow-cheatsheet ()
"Custom cheatsheet that uses a grid instead of fragile ASCII art."
(interactive)
(let ((buf (get-buffer-create "*Meow Cheatsheet*")))
(with-current-buffer buf
(text-mode)
(setq buffer-read-only nil)
(erase-buffer)
(insert "Meow Custom Layout Cheatsheet\n")
(insert "====================================================================================================\n\n")
(insert (my-meow-render-grid))
(insert "\n====================================================================================================\n")
(insert meow--cheatsheet-note)
(insert (meow--render-cheatsheet-thing-table))
(add-face-text-property (point-min) (point-max) 'meow-cheatsheet-command)
(setq buffer-read-only t))
(switch-to-buffer buf)))
(defun meow-setup ()
;; We no longer need the physical-layout strings because we use my-meow-board-grid
(meow-motion-overwrite-define-key
'("j" . meow-next)
'("k" . meow-prev)
'("<escape>" . mode-line-other-buffer))
(meow-leader-define-key
'("/" . meow-keypad-describe-key)
'("?" . my-meow-cheatsheet)) ;; Use our new custom renderer here
(meow-normal-define-key
'("0" . meow-expand-0)
'("9" . meow-expand-9)
'("8" . meow-expand-8)
'("7" . meow-expand-7)
'("6" . meow-expand-6)
'("5" . meow-expand-5)
'("4" . meow-expand-4)
'("3" . meow-expand-3)
'("2" . meow-expand-2)
'("1" . meow-expand-1)
'("-" . negative-argument)
'(";" . meow-reverse)
'("," . meow-inner-of-thing)
'("." . meow-bounds-of-thing)
'("[" . meow-beginning-of-thing)
'("]" . meow-end-of-thing)
'("a" . meow-append)
'("A" . meow-open-below)
'("b" . meow-back-word)
'("B" . meow-back-symbol)
'("c" . meow-change)
'("d" . meow-delete)
'("D" . meow-backward-delete)
'("e" . meow-next-word)
'("E" . meow-next-symbol)
'("f" . meow-find)
'("g" . meow-cancel-selection)
'("G" . meow-grab)
'("h" . meow-left)
'("H" . meow-left-expand)
'("i" . meow-insert)
'("I" . meow-open-above)
'("j" . meow-next)
'("J" . meow-next-expand)
'("k" . meow-prev)
'("K" . meow-prev-expand)
'("l" . meow-right)
'("L" . meow-right-expand)
'("m" . meow-join)
'("n" . meow-search)
'("o" . meow-block)
'("O" . meow-to-block)
'("p" . meow-yank)
;;'("q" . meow-quit)
'("Q" . meow-goto-line)
'("r" . meow-replace)
'("R" . meow-swap-grab)
'("k" . meow-kill)
'("t" . meow-till)
'("u" . meow-undo)
'("U" . meow-undo-in-selection)
'("v" . meow-visit)
'("w" . meow-mark-word)
'("W" . meow-mark-symbol)
'("x" . meow-line)
'("X" . meow-goto-line)
'("y" . meow-save)
'("Y" . meow-sync-grab)
'("z" . meow-pop-selection)
'("'" . repeat)))
+69
View File
@@ -0,0 +1,69 @@
;"Generate an aligned, fontified buffer of all Denote files using fd."
(defvar denote-browser-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "RET") 'denote-browser-open-file)
map)
"Keymap for the custom Denote browser.")
(defface denote-browser-dir '((t :inherit font-lock-comment-face)) "Face for subdirs.")
(defface denote-browser-id '((t :inherit font-lock-constant-face)) "Face for IDs.")
(defface denote-browser-title '((t :inherit font-lock-keyword-face :weight bold)) "Face for titles.")
(defface denote-browser-tags '((t :inherit font-lock-type-face)) "Face for tags.")
(defun denote-browser-open-file ()
"Open the file on the current line."
(interactive)
(if (get-text-property (point) 'denote-path)
(find-file (get-text-property (point) 'denote-path))
(message "No file on this line.")))
(defun list-denote-files ()
"Generate an aligned, fontified buffer of all Denote files using fd."
(interactive)
(let* ((default-directory (expand-file-name "~/lyrinv/SOR/Notes/"))
(raw-output (shell-command-to-string "fd -t f"))
(lines (split-string raw-output "\n" t))
(buf (get-buffer-create "*Denote Browser*")))
(with-current-buffer buf
(let ((inhibit-read-only t))
(erase-buffer)
(use-local-map denote-browser-map)
(setq-local buffer-read-only t)
(dolist (line lines)
;; Regex to break down: Subdir/ + ID + Title + Keywords
(if (string-match "^\\(.*\\/\\)?\\([0-9A-Za-z]+\\)--\\([^\n__]+\\)\\(__.*\\)?\\.\\([a-z]+\\)$" line)
(let* ((dir (or (match-string 1 line) ""))
(id (or (match-string 2 line) ""))
(title (or (match-string 3 line) ""))
(tags (or (match-string 4 line) ""))
(full-path (expand-file-name line default-directory))
(start (point)))
;; Clean up trailing slash and tag underscores for legibility
(setq dir (if (string-empty-p dir) "." (directory-file-name dir)))
(setq tags (if (string-empty-p tags) "" (replace-regexp-in-string "__" " " tags)))
;; Insert padded, aligned string components
(insert (propertize (format "%-20s " dir) 'face 'denote-browser-dir))
(insert (propertize (format "%-16s " id) 'face 'denote-browser-id))
(insert (propertize (format "%-45s " title) 'face 'denote-browser-title))
(insert (propertize tags 'face 'denote-browser-tags))
(insert "\n")
;; Attach the raw file path to the entire line for RET to use
(add-text-properties start (point) (list 'denote-path full-path)))
;; Fallback layout for non-standard files (e.g., gereedschap.ods)
(let* ((dir (or (file-name-directory line) "."))
(file (file-name-nondirectory line))
(full-path (expand-file-name line default-directory))
(start (point)))
(insert (propertize (format "%-20s " (directory-file-name dir)) 'face 'denote-browser-dir))
(insert (propertize (format "%-16s " "No-ID") 'face 'denote-browser-id))
(insert (propertize file 'face 'denote-browser-title))
(insert "\n")
(add-text-properties start (point) (list 'denote-path full-path)))))))
(pop-to-buffer buf)))
+100 -12
View File
@@ -28,11 +28,9 @@ Absolutely zero interaction with the Emacs kill ring."
Never falls back to or checks the Emacs kill ring."
(interactive)
(if (display-graphic-p)
(let ((text (or (gui-backend-get-selection 'CLIPBOARD 'STRING)
(gui-backend-get-selection 'CLIPBOARD 'UTF8_STRING)
(gui-backend-get-selection 'PRIMARY 'STRING)
;; Wayland/Dolphin fallback from previous fix
(when (executable-find "wl-paste")
(let ((text (or (gui-get-selection 'CLIPBOARD)
(gui-get-selection 'PRIMARY)
(when (executable-find "wl-paste")
(let ((val (shell-command-to-string "wl-paste -n -t text/plain")))
(unless (string-empty-p val) val))))))
(if text
@@ -41,13 +39,103 @@ Never falls back to or checks the Emacs kill ring."
;; TUI Fallback
(message "In a terminal, use your terminal emulator's native paste shortcut (e.g., Ctrl-Shift-V).")))
(defun my/vterm-sync-here ()
"Switch to vterm and instantly 'cd' to the current buffer's directory."
(defun my/system-paste-via-yank ()
"Pure paste: Overwrites the kill ring with clipboard data and triggers local yank."
(interactive)
(let ((cwd default-directory))
(vterm-toggle)
(vterm-send-string (format "cd %s" (shell-quote-argument cwd)))
(vterm-send-return)))
(let ((text (or (gui-get-selection 'CLIPBOARD)
(gui-get-selection 'PRIMARY)
(when (executable-find "wl-paste")
(when (executable-find "wl-paste")
(let ((val (shell-command-to-string "wl-paste -n -t text/plain")))
(unless (string-empty-p val) val))))
nil)))
(if text
(progn
;; Forcibly stage to the kill ring. With kill-ring-max=1, this replaces everything.
(kill-new text)
;; Resolve the context-aware yank command (handles terminal wrappers automatically)
(let ((local-yank (key-binding (kbd "C-y"))))
(if (commandp local-yank)
(call-interactively local-yank)
(call-interactively 'yank))))
(user-error "System clipboard is empty"))))
(defun my/sync-clipboard-to-kill-ring ()
"Explicitly pull the system clipboard into the Emacs kill ring without pasting."
(interactive)
(let ((text (or (gui-get-selection 'CLIPBOARD)
(gui-get-selection 'PRIMARY)
(when (executable-find "wl-paste")
(when (executable-find "wl-paste")
(let ((val (shell-command-to-string "wl-paste -n -t text/plain")))
(unless (string-empty-p val) val))))
nil)))
(if text
(progn
(kill-new text)
(message "System clipboard staged to kill ring."))
(user-error "System clipboard is empty"))))
(defun dired-wayland-copy-marked-files ()
"Copy marked files in Dired to the Wayland clipboard as text/uri-list."
(interactive)
(let* ((files (dired-get-marked-files))
;; Convert paths to file:// URIs and join with newlines
(uri-list (mapconcat (lambda (file) (concat "file://" file)) files "\n")))
(when files
(let ((process-connection-type nil))
(let ((proc (start-process "wl-copy-uri" nil "wl-copy" "-t" "text/uri-list")))
(process-send-string proc uri-list)
(process-send-eof proc)))
(message "Copied %d file(s) to Wayland clipboard." (length files)))))
(defun dired-wayland-paste-files ()
"Paste files from the Wayland clipboard (text/uri-list) into the current Dired directory."
(interactive)
(let ((default-directory (dired-current-directory)))
(with-temp-buffer
;; Call wl-paste to get the uri-list
(call-process "wl-paste" nil t nil "-t" "text/uri-list")
(goto-char (point-min))
(let ((files '()))
;; Parse file:// URIs line by line
(while (re-search-forward "^file://\\(.*\\)$" nil t)
(push (match-string 1) files))
(if files
(progn
;; Copy files to the current directory using dired's native copying
(dolist (file files)
(when (file-exists-p file)
(dired-copy-file file default-directory t)))
(revert-buffer) ; Refresh dired buffer
(message "Pasted %d file(s)." (length files)))
(message "No files found in Wayland clipboard."))))))
;; Bind keys in dired-mode
(with-eval-after-load 'dired
(define-key dired-mode-map (kbd "Y") #'dired-wayland-copy-marked-files)
(define-key dired-mode-map (kbd "P") #'dired-wayland-paste-files))
(defun my/mc-copy-regions-as-block ()
"Copy all active multiple-cursors regions joined by newlines into the kill ring."
(interactive)
(if (and (bound-and-true-p multiple-cursors-mode)
(use-region-p))
(let ((strings (mapcar (lambda (cursor)
(let ((beg (mc/cursor-beg cursor))
(end (mc/cursor-end cursor)))
(buffer-substring-no-properties beg end)))
(mc/all-fake-cursors))))
;; Add the main cursor's region as well
(push (buffer-substring-no-properties (region-beginning) (region-end)) strings)
;; Sort by position so they match document order
(setq strings (mapcar #'cdr
(sort (cl-mapcar #'cons
(cons (point) (mapcar #'mc/cursor-beg (mc/all-fake-cursors)))
strings)
(lambda (a b) (< (car a) (car b))))))
(kill-new (string-join strings "\n"))
(message "Copied %d cursor regions as a block." (length strings)))
(message "No active multiple-cursors regions to copy.")))
(provide 'system)
;;unqualified-search-registries = ["docker.io"]
+6 -2
View File
@@ -1,18 +1,22 @@
;;; ../../lyfi/configs/apps/doom/custom/ui.el -*- lexical-binding: t; -*-
(defun my-set-buffer-font ()
"Set a specific font for the current buffer only."
(buffer-face-set '(:family "Noto Sans" :height 140)))
(defun my/apply-theme (frame)
"Apply a specific theme and update package colors based on whether the FRAME is graphic or TUI."
(select-frame frame)
(if (display-graphic-p frame)
(progn
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'cutarv41 t)
(load-theme 'cutarv42 t)
;; Update rainbow-delimiters colors for Light theme
(setq rainbow-delimiters-rainbow-colors
'("#007cbf" "#cf3f29" "#2374de" "#c75e10" "#b05197" "#429e66" "#129cc9" "#a64dd6")))
(progn
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'cutarv41 t)
(load-theme 'cutarv42 t)
;; Update rainbow-delimiters colors for Dark theme
;; (setq rainbow-delimiters-rainbow-colors
;; '("#4da6ff" "#ff6b6b" "#6da6ff" "#ffb347" "#d18ecb" "#8fbc8f" "#80daeb" "#c8a0f2"))
-28
View File
@@ -1,28 +0,0 @@
;;; ../../lyfi/configs/apps/doom/custom/unifiedlist.el -*- lexical-binding: t; -*-
(defun my/get-unified-list ()
"Combine buffers and recentf into a list for tabulated-list-mode."
(let ((items '()))
;; Add Live Buffers
(dolist (buf (buffer-list))
(with-current-buffer buf
(push (list buf (vector (buffer-name) "Live" (format-mode-line mode-name) (or (buffer-file-name) ""))) items)))
;; Add Recent Files (if not already open)
(dolist (file recentf-list)
(unless (get-file-buffer file)
(push (list file (vector (file-name-nondirectory file) "Recent" "File" file)) items)))
(nreverse items)))
(define-derived-mode my-unified-list-mode tabulated-list-mode "Unified-List"
(setq tabulated-list-format [("Name" 30 t)
("Status" 10 t)
("Mode" 15 t)
("Path" 0 t)])
(setq tabulated-list-entries #'my/get-unified-list)
(tabulated-list-init-header))
(defun my/open-unified-list ()
(interactive)
(pop-to-buffer "*Unified Switcher*")
(my-unified-list-mode)
(tabulated-list-print))
+1 -16
View File
@@ -39,10 +39,6 @@ Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
(delete-region (point) end)))))
(defun my-set-buffer-font ()
"Set a specific font for the current buffer only."
(buffer-face-set '(:family "Noto Sans" :height 140)))
(defun my/toggle-quote-wrap-all-in-region (beg end)
"Toggle wrapping all items in region with double quotes."
;;https://xenodium.com/emacs-quote-wrap-all-in-region
@@ -60,17 +56,6 @@ Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
(delete-region beg end)
(insert replacement)))
(defun my/meow-wrap-arbitrary (s e)
"Wrap the current meow selection with arbitrary strings."
(interactive "r")
(let ((start-str (read-string "Start: "))
(end-str (read-string "End: ")))
(save-excursion
(goto-char e)
(insert end-str)
(goto-char s)
(insert start-str))))
(defun my/column-align-regexp ()
"Aligns the matched regexp to `comment-column`.
If the text preceding the regexp is already past `comment-column`,
@@ -81,7 +66,7 @@ it ensures exactly one space of separation."
(target-col (if (and (boundp 'comment-column)
(numberp comment-column))
comment-column
40))
80))
(start (region-beginning))
(end (region-end)))