From 62dcea0d52f4133a046b2d3da31c46dd635dda57 Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Thu, 22 Aug 2024 22:36:26 +0100 Subject: [PATCH] embark: Add action to copy basename --- init.org | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index 2e9d1f7..e45d832 100644 --- a/init.org +++ b/init.org @@ -10118,10 +10118,23 @@ Welcome to my personal Emacs configuration 😎. (mkdir dir t)) (find-file dir)) + :commands embark-save-basename+ + :config + (defun embark-save-basename+ (file) + "Save the basename of FILE in the kill ring." + (interactive "FFile: ") + (thread-first + file + (substitute-in-file-name) + (directory-file-name) + (file-name-nondirectory) + (kill-new))) + :general (:keymaps 'embark-file-map "m" 'embark-find-mkdir+ - "+" 'embark-find-mkdir+) + "+" 'embark-find-mkdir+ + "%" 'embark-save-basename+) ;; Embark core bindings.