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:
parent
33e922645b
commit
e19a6523ae
1 changed files with 8 additions and 4 deletions
|
@ -46,10 +46,14 @@
|
||||||
(error "Couldn't find filename in current buffer")))
|
(error "Couldn't find filename in current buffer")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/yank-buffer-path-relative-to-project ()
|
(defun +default/yank-buffer-path-relative-to-project (&optional include-root)
|
||||||
"Copy the current buffer's path to the kill ring."
|
"Copy the current buffer's path to the kill ring.
|
||||||
(interactive)
|
With non-nil prefix INCLUDE-ROOT, also include the project's root."
|
||||||
(+default/yank-buffer-path (doom-project-root)))
|
(interactive "P")
|
||||||
|
(+default/yank-buffer-path
|
||||||
|
(if include-root
|
||||||
|
(file-name-directory (directory-file-name (doom-project-root)))
|
||||||
|
(doom-project-root))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/insert-file-path (arg)
|
(defun +default/insert-file-path (arg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue