diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-22 12:23:13 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-22 12:23:13 -0500 |
| commit | 2dd3aed6971fe74915c1fc09b4de20a6c64e817b (patch) | |
| tree | f9d896ebcfd0e6a2acb2684ff085a42324a9a638 /modules/dirvish-config.el | |
| parent | 5d18558615a127640d6b4e634997ee35a5fe1b77 (diff) | |
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
Diffstat (limited to 'modules/dirvish-config.el')
| -rw-r--r-- | modules/dirvish-config.el | 36 |
1 files changed, 34 insertions, 2 deletions
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"))) ("<left>" . dired-up-directory) ("<right>" . 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) |
