simplified config a bit
This commit is contained in:
@@ -76,46 +76,6 @@ Never falls back to or checks the Emacs kill ring."
|
||||
(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)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
;;; ../../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 '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 'cutarv42 t)
|
||||
;; Update rainbow-delimiters colors for Dark theme
|
||||
;; (setq rainbow-delimiters-rainbow-colors
|
||||
;; '("#4da6ff" "#ff6b6b" "#6da6ff" "#ffb347" "#d18ecb" "#8fbc8f" "#80daeb" "#c8a0f2"))
|
||||
))
|
||||
(custom-set-faces
|
||||
`(meow-insert-cursor ((t (:inherit unspecified :background ,(face-attribute 'font-lock-builtin-face :foreground)))))
|
||||
`(meow-normal-cursor ((t (:foreground ,(face-attribute 'mode-line-inactive :background), :background ,(face-attribute 'mode-line :foreground)))))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(provide 'ui)
|
||||
+7
-44
@@ -1,13 +1,5 @@
|
||||
;;; utils.el --- General utility functions -*- lexical-binding: t; -*-
|
||||
|
||||
(defun dired-follow-symlink ()
|
||||
"In dired, visit the file or directory at point by its true physical path."
|
||||
(interactive)
|
||||
(let ((filename (dired-get-file-for-visit)))
|
||||
(if filename
|
||||
(find-file (file-truename filename))
|
||||
(message "No file at point"))))
|
||||
|
||||
(defun my/delete-word-backward ()
|
||||
"Delete the previous 'block' of characters without killing them.
|
||||
Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
|
||||
@@ -39,22 +31,13 @@ Blocks are defined by: whitespace, alphanumerics, or groups of symbols."
|
||||
|
||||
(delete-region (point) end)))))
|
||||
|
||||
(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
|
||||
(interactive (list (mark) (point)))
|
||||
(unless (region-active-p)
|
||||
(user-error "no region to wrap"))
|
||||
(let ((deactivate-mark nil)
|
||||
(replacement (string-join
|
||||
(mapcar (lambda (item)
|
||||
(if (string-match-p "^\".*\"$" item)
|
||||
(string-trim item "\"" "\"")
|
||||
(format "\"%s\"" item)))
|
||||
(split-string (buffer-substring beg end)))
|
||||
" ")))
|
||||
(delete-region beg end)
|
||||
(insert replacement)))
|
||||
(defun dired-follow-symlink ()
|
||||
"In dired, visit the file or directory at point by its true physical path."
|
||||
(interactive)
|
||||
(let ((filename (dired-get-file-for-visit)))
|
||||
(if filename
|
||||
(find-file (file-truename filename))
|
||||
(message "No file at point"))))
|
||||
|
||||
(defun my/column-align-regexp ()
|
||||
"Aligns the matched regexp to `comment-column`.
|
||||
@@ -101,26 +84,6 @@ it ensures exactly one space of separation."
|
||||
;; Optional: Bind it to a key for easier access
|
||||
;; (global-set-key (kbd "C-c a l") 'my/column-align-regexp)
|
||||
|
||||
|
||||
(defun diff-buffers (buffer-a buffer-b)
|
||||
"Generate a diff between BUFFER-A and BUFFER-B using standard diff.
|
||||
Prompts for the two buffers, defaulting to the current buffer and the
|
||||
most recently active one."
|
||||
(interactive
|
||||
(let* ((current (current-buffer))
|
||||
(other (other-buffer current t))
|
||||
(buf-a (read-buffer "New buffer (to diff): " current t))
|
||||
(buf-b (read-buffer "Old buffer (against): " other t)))
|
||||
(list (get-buffer buf-a) (get-buffer buf-b))))
|
||||
|
||||
(let ((name-a (buffer-name buffer-a))
|
||||
(name-b (buffer-name buffer-b)))
|
||||
(diff buffer-b buffer-a nil t)
|
||||
;; Rename the diff output buffer to make it clear what was diffed
|
||||
(when (get-buffer "*Diff*")
|
||||
(with-current-buffer "*Diff*"
|
||||
(rename-buffer (format "*Diff: %s vs %s*" name-b name-a) t)))))
|
||||
|
||||
(defun my/list-no-prefix-bindings (keymap &optional map-name)
|
||||
"Extract and display all single-key (no-prefix) bindings from KEYMAP.
|
||||
Outputs a clean list into a dedicated buffer."
|
||||
|
||||
Reference in New Issue
Block a user