mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feat(default): may include project name for SPC f Y
+default/yank-buffer-path-relative-to-project: with non-nil prefix arg, copy the file name relative to the project root's parent. Sometimes we also want to specify the project name to let others know which is the currently mentioned project.
This commit is contained in:
@ -46,10 +46,14 @@
|
||||
(error "Couldn't find filename in current buffer")))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/yank-buffer-path-relative-to-project ()
|
||||
"Copy the current buffer's path to the kill ring."
|
||||
(interactive)
|
||||
(+default/yank-buffer-path (doom-project-root)))
|
||||
(defun +default/yank-buffer-path-relative-to-project (&optional include-root)
|
||||
"Copy the current buffer's path to the kill ring.
|
||||
With non-nil prefix INCLUDE-ROOT, also include the project's root."
|
||||
(interactive "P")
|
||||
(+default/yank-buffer-path
|
||||
(if include-root
|
||||
(file-name-directory (directory-file-name (doom-project-root)))
|
||||
(doom-project-root))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/insert-file-path (arg)
|
||||
|
Reference in New Issue
Block a user