Skip to content

Commit

Permalink
embark: Add action to copy basename
Browse files Browse the repository at this point in the history
  • Loading branch information
mohkale committed Aug 22, 2024
1 parent 2e4314a commit 62dcea0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion init.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 62dcea0

Please sign in to comment.