From 2dd3aed6971fe74915c1fc09b4de20a6c64e817b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 22 Apr 2024 12:23:13 -0500 Subject: New Custom Functions, Org Updates, Agenda Updates, &c. === Functions === - add function cj/dired-convert-image-to-jpeg - add function cj/dired-copy-path-as-kill - add function cj/export-org-to-md-on-save function - add function cj/org-link-to-current-file === Agenda === - rework the f8 main agenda into custom agenda using Aaron Bieber's ideas - agenda lists now use standard agenda functions - updated packages to remove org-super-agenda and ts (a dependency) - file commentary text updated to reflect the change === Org === - add grocery and shopping list capture items - add missing tests for org-skip-subtree-if-habit - add support for org-habits, including checkboxes - fix issue with org-auto-export-to-md - modularize org-agenda - move todo settings to org-config - reformat org-roam-config === &c. === - add day to sortable date - add disablefastrenderer to hugo server flags - add fill column indicator when emacs lisping - add gpt buffers to the bury-alive-list - add keybinding for fixup-whitespace - add magit cloning settings - finish automatically on "Link" capture - fix company complaints about shutting up function - fix em, e, ff, and f eshell aliases - make fallback theme modus-vivendi - prune the compilation cache when applicable --- modules/dirvish-config.el | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'modules/dirvish-config.el') diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el index f35d2934..12f67519 100644 --- a/modules/dirvish-config.el +++ b/modules/dirvish-config.el @@ -31,6 +31,35 @@ ;; (add-hook 'dired-mode-hook 'auto-revert-mode) ;; auto revert dired when files change +;; -------------------------- Dired Copy Path As Kill -------------------------- +;; copies the full path of the file at point to the clipboard + +(defun cj/dired-copy-path-as-kill () + "Copy the full path of file at point in dired to the clipboard." + (interactive) + (let ((filename (dired-get-file-for-visit))) + (if (and filename (file-exists-p filename)) + (progn + (kill-new filename) + (message "Copied '%s' to clipboard." filename)) + (message "No file at point.")))) + +;; ------------------------ Dired Convert Image To Jpeg ------------------------ +;; converts the image at point to a jpeg + +(defun cj/dired-convert-image-to-jpeg () + (interactive) + (let* ((original-file (dired-get-file-for-visit)) + (file-extension (file-name-extension original-file)) + (jpeg-file (concat (file-name-sans-extension original-file) ".jpeg"))) + (if (member file-extension '("png" "bmp" "gif" "tif" "tiff" "svg" "webp")) + (if (string= file-extension "jpeg") + (message "File is already in JPEG format.") + (start-process "convert-to-jpeg" nil "convert" original-file jpeg-file) + (message "Conversion started for %s" original-file)) + (message (concat "File is not a supported image file type." + "Current supported types: " + "'png' 'bmp' 'gif' 'tif' 'tiff' 'svg' 'webp'"))))) ;; ------------------------ Dired Mark All Visible Files ----------------------- ;; convenience function to mark all visible files in dired @@ -55,7 +84,8 @@ '(("h" "~/" "home") ("rsb" "/sshx:cjennings@wolf.usbx.me:/home/cjennings/" "remote seedbox") ("rcj" "/sshx:cjennings@cjennings.net:~" "remote cjennings.net") - ("co" "~/code" "code") + ("co" "~/code" "code") + ("cj" "~/code/cjennings-net" "cjennings.net hugo") ("df" "~/.dotfiles/" "dotfiles") ("dn" "~/downloads/" "downloads") ("dr" "~/sync/org/drill/" "org drill files") @@ -95,10 +125,12 @@ (shell-command (concat "nitrogen --save --set-zoom-fill " (dired-file-name-at-point) " >>/dev/null 2>&1" )))) ("Z" . (lambda () (interactive) (cj/open-file-with-command "zathura"))) - ("p" . (lambda () (interactive) (cj/open-file-with-command "gimp"))) + ("P" . (lambda () (interactive) (cj/open-file-with-command "gimp"))) ("" . dired-up-directory) ("" . dired-find-file) ("f" . dirvish-file-info-menu) + ("p" . cj/dired-copy-path-as-kill) + ("C" . cj/dired-convert-image-to-jpeg) ("y" . dirvish-yank-menu) ("N" . dirvish-narrow) ("M" . cj/dired-mark-all-visible-files) -- cgit v1.2.3